i'm saving markers coordinates in mysql like below image
what i need is when user draw on maps like below image
i could get the shape and select markers in the shape from mysql and create a query.
Google maps does not provide GIS functions to select the coordinates inside a polygon. You could do using the spatial extension ( data type GEOMETRY) for mysql .. and for this you can go into that ..http://dev.mysql.com/doc/refman/5.7/en/spatial-extensions.html for mysql doc.
A simple way to select locations (points) in google maps is to use the extreme values of the coordinates of the polygon points to get the equivalent to the coordinates of the rectangle that contains the polygon vertices and then perform a select
select location from my_table where location_lat >= minLat_polygon AND location_lat <= maxLat_poligon AND location_lng <= maxLng_polygon AND location_lng >= minLng_polygon