Should Google Maps Overlays appear?

Should the Info Window feature from Google Maps overlays work? I tried some things and can draw circles on the map, but I cannot get the Info Window type of overlay to work.

I’d like to show some text next to the dots.

https://developers.google.com/maps/documentation/javascript/overlays#CustomOverlays

Thanks!

I’m assuming this is in reference to the Custom HTML Block? Google Maps falls outside our area of expertise but I do have some experience working with them; if you can paste a code sample here, I can take a look and see if anything jumps out.

Make sure to remove any API keys or sensitive information before pasting the code.

Yes, the Customer HTML Block. Well nuts, I had deleted my previous code and then attempted to find some example for you. In doing so, i was able to get this to work:

Let’s say I want to print the number 10 on the map in a marker. This code works, presuming the map has been defined and plots circles whatnot:

   var marker = new google.maps.Marker({
     position: center,
         label: "10",
	     map: map
   });

Or if it’s a variable you want to show (my goal) then this works too:

   someInteger = 10;

  var marker = new google.maps.Marker({
     position: center,
         label: someInteger.toString(),
	     map: map
   });

https://developers.google.com/maps/documentation/javascript/markers#marker_labels

Glad to hear you got it working, and thanks for posting your solution for future users!

1 Like