Tag Archives | Google Maps
Google Maps JavaScript API v3: how to get the center lat & lon of a polygon

Google Maps JavaScript API v3: how to get the center lat & lon of a polygon

How to get the center lat & lon of a polygon? We can do it just by calling polygon.getBounds().getCenter() Note: in Google Maps JavaScript API v2, Polygon had a getBounds() method, but that doesn’t exist for v3 Polygon. You can find that method in this article.

Read full story Comments { 0 }
Google Maps JavaScript API v3: method Polygon.getBounds

Google Maps JavaScript API v3: method Polygon.getBounds

In Google Maps JavaScript API v2, Polygon had a getBounds() method, but that doesn’t exist for v3 Polygon. Here’s the solution: Here, we present a simplified method: Image copyright: Google maps

Read full story Comments { 0 }
Google Maps JavaScript API v3: method Polyline.getBounds

Google Maps JavaScript API v3: method Polyline.getBounds

In Google Maps JavaScript API v2, Polyline had a getBounds() method, but that doesn’t exist for v3 Polyline. I wrote some methods below: Method 1: Method 2: Method 3 is the shortest method. Image copyright: Google Maps

Read full story Comments { 0 }