【发布时间】:2013-09-13 02:03:35
【问题描述】:
我想将标记自动移动到 x 公里。
这是我的代码:
geocoder.geocode({'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var myMap = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 11,
center: myMap,
scrollwheel: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById("show_map"), myOptions);
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
position: results[0].geometry.location,
flat: false,
map: map
});
}
}
我该怎么做?
谢谢。
【问题讨论】:
-
x 公里在哪里?朝什么方向?你试过什么?
-
感谢您的回答。从标记的原始位置随机 x 公里。
-
@Beno,你能解释一下你想要达到的目标吗?加载地图时,您是想将标记从位置 A 移动到位置 B,还是只想为其设置动画?
-
我只想在没有动画的情况下将标记从位置 A 移动到位置 B。这是一个房地产网站,我不想显示房产的真实位置。谢谢你,马丁。
-
喜欢this?
标签: google-maps google-maps-api-3 google-maps-markers geocoding