Reputation: 1514
I am using google map v3 and its drawingManager feature, I want to get the pixels of these Shapes either through Lat and Long or directly.
Here is the URL of drawingManager Shapes
https://developers.google.com/maps/documentation/javascript/examples/user-editable-shapes
I want to get the pixels as here with respect to the container of map
like here, buts using overlay class and I want to use it for DrawingManager Shapes, need some help on it.
Thanks
Upvotes: 0
Views: 413
Reputation: 117334
To translate a LatLng to a Point use the method fromLatLngToPoint()
of the current projection.
The current projection is returned by mapObject.getProjection()
However, a shape isn't always defined by LatLng's/Points. For rectangles you must translate the points defined by the bounds, for a circle the center(and/or bounds), and for polylines/polygons the path.
Upvotes: 1