如何在使用imagemaptype的gettileurl方法时删除poi?

k7fdbhmy  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(141)

我试图在修改Map类型注册表时删除poi。我遇到的问题是,当我使用imagemaptype的gettileurl方法时,我添加到选项中的样式会消失。请看一下这个示例:

map.setOptions({
    mapTypeControlOptions: {
      mapTypeIds: ["Map", 'VFR', 'IFR Low', 'Satellite'],
      position: google.maps.ControlPosition.TOP_LEFT
    },
    mapTypeId: "Map", //If I remove this line of code, the poi dissapear, else they appear
    styles : [
      { 
        "elementType": "all",
        "featureType": "poi",
        "stylers": [
          {
            "visibility": "off"
          }
        ]
      }
    ]
  });

  map.mapTypes.set(
    "Map",
    new google.maps.ImageMapType({
      getTileUrl: (tileCoord, tileZoom) =>
        `https://mt.google.com/vt/lyrs=p&x=${tileCoord.x}&y=${tileCoord.y}&z=${tileZoom}`,
      tileSize: new google.maps.Size(256, 256),
      name: 'Map',
      maxZoom: 21

    })
  );

我的问题是,在使用imagemaptype的gettileurl时,如何删除poi?
提前谢谢。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题