使用HTML在Google地图iframe中停用POI

时间:2018-01-19 08:10:23

标签: html google-maps iframe

我们正在将Google地图与iframe集成。 不幸的是,地图显示了竞争对手的POI。是否有可能在HTML中使用后缀禁用它们?

http://www.sorba.ch/kontakt



<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d10798.188248369914!2d9.3721622!3d47.4207752!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x1721878daf7af98e!2sSorba+EDV+AG!5e0!3m2!1sde!2sch!4v1507043605585" width="100%" height="450" frameborder="0" style="border:0"></iframe>
&#13;
&#13;
&#13;

或者它只能用JavaScript吗?

2 个答案:

答案 0 :(得分:2)

不,你不能用HTML做到这一点; HTML设置应用程序的初始结构,它不会改变其行为。如果您需要更改从Google服务器返回的响应的行为或样式,您确实可以使用Javascript API。您确实style your map to filter out businesses可以将各自的可见性设置为“关闭”。这是一个快速的样本,你可以建模来实现这个目标:

function initialiseMap() {
      var map = new google.maps.Map(document.getElementById('map'), {

      // center the map to your business address
      // Set a marker with an InfoWindow if you like to model map in the example

      center: {lat: xx.xxxxx, lng: yy.yyyy},
      zoom: zz,
      styles: [
          {
          featureType: “poi.business”,
          elementType: “labels”,
          stylers: [{visibility: “off”}]
          }
        ]
    }

答案 1 :(得分:0)

感谢大家的意见和帮助。 我切换到JavaScript设计的地图。困难但正确的方向。

谁还需要一些帮助或介绍应该访问:

https://mapkit.io/(我使用这个很棒的工具生成基本代码)

https://developers.google.com/maps/documentation/javascript/examples/?hl=de