Relative Content

Tag Archive for javascriptgoogle-maps

Upgrade Marker to AdvancedMarkerElement

I get the notification to upgrade Marker in my generic javascript code.
However I don’t really understand how to modify the script to have AdvancedMarkerElement instead of Marker.
This code is completely generic and loads data from Mysql
The documentation is not very clear on the subject and requires some explanation to proceed with the upgrade

StyledMapType of terrain map type, and others?

As far as I can tell, a google.maps.StyledMapType is (at least by default) a styled version of the default roadmap (google.maps.MapTypeId.ROADMAP). Is there any way to create a StyledMapType based on another map type, such as the terrain map (google.maps.MapTypeId.TERRAIN)?

Removing shapes in Google Maps with JavaScript

Namely, I’m working on an app that allows users to mark certain parts of the land on the map (by drawing shapes) and then get feedback information about the size of that land. Also, there is an option to exclude certain parts on the marked land (for example if there is a house and they don’t want to calculate it in the total results).

Google Maps API: google.maps.Map is not a constructor error

I have a page where Google Maps is loaded, was working correctly. Recently (few days ago) it starting throwing errors at DEV environment. At first with CTRL+F5 this issue would disappear, but now is constantly occurring. I’ve searched for any HTML or JS change into my code that may have caused this, could find any changes. I’ve checked at production enviroment and this issue occurs there too (with older code), therefore this seems to be some external interference.

Google Maps API v3 Algorithm (MarkerClusterer) not working

I initialize map and via ajax function (filters) I want to change numbers of markers (clusters) and star markers loads on map. I tried dynamically initialize markerClusterer in async function because I use advanced Markers (AdvancedMarkerElelement) to load access to this class from “marker” library, but I got not built clusters in t.MarkerClusterer object (clusters returns null). I am using @googlemaps/markerclusterer the unpkg version.