admin管理员组文章数量:1391947
I'm trying to use hybrid mapTypeId, but hide Point of Interest pins.
So I have a style set up in Maps Management with PoIs visibility hidden - however this is a roadmap style and when I use on my JS map with "hybrid" typeId the PoIs are still visible. It used to work before google.maps version 3.60. They pois correctly disappear when I change mapTypeId to "roadmap".
This is how I define the map.
const mapElement = document.getElementById("google-maps-container");
if (!mapElement) {
console.error("Map element not found");
return;
}
const map = new google.maps.Map(mapElement, {
mapId: "*map ID*",
mapTypeId: "hybrid",
The PoIs disappearing seems reasonable, because the cloud style style is a roadmap style. This is in line with the documentation here "Cloud-based maps styling affects only the default roadmap map type"
However when creating a style there is no option to create a style for different type of map. As seen below
I technically can just not use mapId and define styles in code, but without mapId I cannot use the AdvancedMarker (which I use to pin selected location) and the not-advanced Marker is deprecated. Applying styles in-code with mapId set doesn't work either since it ignores the styles and tries to apply cloud map styles, even though they don't work for hybrid map type.
Is there any solution for that? I just want to use hybrid map and non deprecated marker and hide the pois.
I tried to create Google Maps map style with hybrid type, but I can only select roadmap type. I tried to apply this style to my hybrid map but it does not work. It works on a roadmap map. It used to work one month ago.
本文标签: Can I use Cloud Google Maps Styles on mapTypeId other than roadmapStack Overflow
版权声明:本文标题:Can I use Cloud Google Maps Styles on mapTypeId other than roadmap? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744746288a2622899.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论