MZH
MZH

Reputation: 1514

Overlay with DrawingManager google map v3

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

http://gmaps-samples-v3.googlecode.com/svn/trunk/latlng-to-coord-control/latlng-to-coord-control.html

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

Answers (1)

Dr.Molle
Dr.Molle

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

Related Questions