谷歌地图半径

时间:2012-05-08 10:45:59

标签: javascript php google-maps

我想知道是否可以在Google地图中添加半径分隔符 !? 例如:我选择了一个地区或一个城市,我的半径为5英里,分隔符增加,绘制它!

请考虑这个例子:我选择“阿姆斯特丹”作为地方,然后我加上5公里它将返回“阿姆斯特丹”加上5公里半径的结果

http://www.funda.nl/koop/amsterdam/+5km/

我的问题是我不明白如何向“阿姆斯特丹”增加5公里,因为它不能成为中心点 - 我想我需要区域“阿姆斯特丹”的分隔符。这是否存在于Google Maps API或任何其他API上?

1 个答案:

答案 0 :(得分:2)

更新

Map Charts

根据您的要求,我认为以上链接可以帮助您。

试试这个,

// Create marker 
var marker = new google.maps.Marker({
  map: map,
  position: new google.maps.LatLng(39.7433,-104.9872),
  title: 'Some location'
});

// Add circle overlay and bind to marker
var circle = new google.maps.Circle({
  map: map,
  radius: 8047,    // 5 miles in metres
  fillColor: '#AA0000'
});
circle.bindTo('center', marker, 'position');

参考: http://seriouscodage.blogspot.in/2010/11/visualizing-data-as-circles-in-google.html