click event listener on styled map icons and labels

There is no API-based access to the POI’s . But there is a possible workaround. When you click on a POI an InfoWindow opens. It’s possible to modify the InfoWindow-prototype to be able to access the content of the InfoWindow without having a reference to the InfoWindow-instance. //store the original setContent-function var fx = google.maps.InfoWindow.prototype.setContent; … Read more

Google has started highlighting search areas in Pink color. Is this feature available in Google Maps API 3?

No. It’s not available in the API. (It may be available in the future. Features of Google Maps do migrate into the API, but Google don’t make announcements in advance and no-one has a crystal ball.) You would need to find the city boundaries and draw the line yourself. Boundary data is almost certainly public-domain … Read more

Trigger event with infoWindow or InfoBox on click Google Map API V3

Ok I figured this out for infoWindow, but then I also figured it out for InfoBox since it is prettier and more customizable. I’m new to JavaScript and these closures can be very tricky. For infoWindow <!doctype html> <html lang=”en”> <head> <title>jQuery mobile with Google maps – Google maps jQuery plugin</title> <link rel=”stylesheet” href=”http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css” /> … Read more

Change marker size in Google maps V3

This answer expounds on John Black’s helpful answer, so I will repeat some of his answer content in my answer. The easiest way to resize a marker seems to be leaving argument 2, 3, and 4 null and scaling the size in argument 5. var pinIcon = new google.maps.MarkerImage( “http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|FFFF00”, null, /* size is determined … Read more

Retrieve latitude and longitude of a draggable pin via Google Maps API V3

Either of these work google.maps.event.addListener(marker, ‘click’, function (event) { document.getElementById(“latbox”).value = event.latLng.lat(); document.getElementById(“lngbox”).value = event.latLng.lng(); }); google.maps.event.addListener(marker, ‘click’, function (event) { document.getElementById(“latbox”).value = this.getPosition().lat(); document.getElementById(“lngbox”).value = this.getPosition().lng(); }); You might also consider using the dragend event also google.maps.event.addListener(marker, ‘dragend’, function (event) { document.getElementById(“latbox”).value = this.getPosition().lat(); document.getElementById(“lngbox”).value = this.getPosition().lng(); });

Using Icon Fonts as Markers in Google Maps V3

I just had the same problem – decided to do a quick and dirty conversion and host on github. https://github.com/nathan-muir/fontawesome-markers You can manually include the JS file, or use npm install fontawesome-markers or bower install fontawesome-markers. Just include the javascript file fontawesome-markers.min.js and you can use them like so: new google.maps.Marker({ map: map, icon: { … Read more