javascript - how to select markers in the polygon from mysql -


i'm saving markers coordinates in mysql below image

enter image description here

what need when user draw on maps below image

enter image description here

i shape , select markers in shape mysql , create query.
example:
$query= mysql_query("select location table coordinates in polygon");


belive need use ajax. , i'm using google maps v3
possible ?
please help, idea somthing other way ??

google maps not provide gis functions select coordinates inside polygon. using spatial extension ( data type geometry) mysql .. , can go ..http://dev.mysql.com/doc/refman/5.7/en/spatial-extensions.html mysql doc.

a simple way select locations (points) in google maps use extreme values of coordinates of polygon points equivalent coordinates of rectangle contains polygon vertices , perform select

  select location     my_table    location_lat >= minlat_polygon   , location_lat  <=  maxlat_poligon   , location_lng  <=  maxlng_polygon   , location_lng  >=  minlng_polygon 

Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -