【问题标题】:Styling/ Theming Google Maps using API V3使用 API V3 设计/主题化 Google 地图
【发布时间】:2012-07-31 12:37:47
【问题描述】:

我正在尝试为我的网站设置 Google 地图的样式,如下所示:http://www.sidewalkprophets.com/shows 它们只显示美国,不幸的是该网站使用 API V2。

使用 Google Maps API V3 是否也能做到这一点?有人可以帮我吗?

【问题讨论】:

标签: javascript google-maps google-maps-api-3 google-maps-api-2


【解决方案1】:

我有一个简单的表格供您完成,无需编写太多脚本等。

您可以使用 gmap3.net 工具,它可以简单地编辑您的地图。

检查此链接:

Gmap3 editor tool

Tutorial

要锁定位置,您可以使用map.Options{ draggable: false};,这样用户就无法拖动地图,您可以设置所需的纬度和经度以及缩放级别。这是一个简单的例子:

var mapDiv = document.getElementById('mappy');

var mapOptions = {
zoom: 12, //select the zoom that you want
draggable: false, //this will lock the draggable option
center: new google.maps.LatLng(-23.563594, -46.654239), //change here the latitude and longitude 
mapTypeId : google.maps.MapTypeId.ROADMAP
}
pode ser ROADMAP, SATELLITE, HYBRID, TERRAIN
map = new google.maps.Map( mapDiv, mapOptions ); //this will include the variables in one to create the map with the options

祝你好运 =) !

【讨论】:

  • 我编辑了代码,检查一下,如果您的问题解决了,请检查其他有相同问题的用户的答案=)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-14
  • 2013-10-03
  • 1970-01-01
  • 1970-01-01
  • 2023-03-08
  • 2011-04-02
相关资源
最近更新 更多