如何禁用谷歌地图V3的地方? [英] How to disable places on google map V3?

查看:96
本文介绍了如何禁用谷歌地图V3的地方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的应用程序迁移到最新版Google地图API,并发现Google会将其自己的项默认添加到Google地图目录中。
它与我自己的记录看起来并不一致,因为它会在地图上创建可以正确放置的重复项。

I'm trying to migrate my application to latest version of Google map API and found that Google appends it's own items by default from Google Places directory to the map. It does not look right together with my own records as it creates duplicate items on the map which can be placed in correctly.

有没有一个选项隐藏这些本地企业或控制显示的内容和不显示的内容

Is there an option how to hide this local businesses or to control what is shown and what is not?

这里是示例代码:

here is sample code:

<!DOCTYPE html>
<html>
  <head>
    <title>Google Maps JavaScript API v3 Example: Map Simple</title>
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta charset="UTF-8">
    <style type="text/css">
      html, body, #map_canvas {
        margin: 0;
        padding: 0;
        height: 100%;
      }
    </style>
    <script type="text/javascript"
        src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript">
      var map;
      function initialize() {
        var myOptions = {
          zoom: 16,
          center: new google.maps.LatLng(37.422833333333,25.323166666667),
          mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        map = new google.maps.Map(document.getElementById('map_canvas'),
            myOptions);
      }

      google.maps.event.addDomListener(window, 'load', initialize);
    </script>
  </head>
  <body>
    <div id="map_canvas"></div>
  </body>
</html>

正如您在地图上看到的那样,有几个小图标,您可以点击它们,出现在泡泡中。我需要隐藏这个图标,或者至少关闭这个项目的点击事件。

As you can see on map, there are few tiny icons, which you can click on and information would appear in bubble. I need to hide this icons or at least disable on click event for this items.

推荐答案

只是一个指针 - 这似乎是可能的自定义样式的地图。如果我没有弄错,你要找的功能类型是 poi.business ,它的 visiblity 你会将关闭。

Just a pointer - this seems possible with custom styled maps. If I'm not mistaken, the feature type you're looking for would be poi.business, whose visiblity you would turn off.

向导来帮助您构建选项数组。

There's a wizard to help you build the options array.

这篇关于如何禁用谷歌地图V3的地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆