Google Maps: how to get country, state/province/region, city given a lat/long value?

What you are looking for is called reverse geocoding. Google provides a server-side reverse geocoding service through the Google Geocoding API, which you should be able to use for your project. This is how a response to the following request would look like: http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=false Response: { “status”: “OK”, “results”: [ { “types”: [ “street_address” ], … Read more

Disable mouse scroll wheel zoom on embedded Google Maps

I was having the same problem: when scrolling the page then the pointer becomes over the map, it starts to zoom in/out the map instead of continuing scrolling the page. 🙁 So I solved this putting a div with an .overlay exactly before each gmap iframe insertion, see: <html> <div class=”overlay” onClick=”style.pointerEvents=”none””></div> <iframe src=”https://mapsengine.google.com/map/embed?mid=some_map_id” width=”640″ … Read more

Angular2 – Component into dynamically created element

The main rule here is to create component dynamically you need to get its factory. 1) Add dynamic component to entryComponents array besides including into declarations: @NgModule({ … declarations: [ AppInfoWindowComponent, … ], entryComponents: [ AppInfoWindowComponent, … ], }) That is a hint for angular compiler to produce ngfactory for the component even if we … Read more

What parameters should I use in a Google Maps URL to go to a lat-lon?

This is current accepted way to link to a specific lat lon (rather than search for the nearest object). http://maps.google.com/maps?z=12&t=m&q=loc:38.9419+-78.3020 z is the zoom level (1-20) t is the map type (“m” map, “k” satellite, “h” hybrid, “p” terrain, “e” GoogleEarth) q is the search query, if it is prefixed by loc: then google assumes … Read more

Google Maps API V3 Infobox.js removed

It seems that the library is being moved to Github (it seems the infobox.js wasn’t moved yet), see the announcement on main page: https://code.google.com/p/google-maps-utility-library-v3/ But still, the problem with your code is that it’s not a good practise to reference code from code.google.com svn repository. It’s like referencing a code from Github, it can be … Read more

Google Maps V3 – How to calculate the zoom level for a given bounds

Thanks to Giles Gardam for his answer, but it addresses only longitude and not latitude. A complete solution should calculate the zoom level needed for latitude and the zoom level needed for longitude, and then take the smaller (further out) of the two. Here is a function that uses both latitude and longitude: function getBoundsZoomLevel(bounds, … Read more