如下图所示,div
(左上方)显示了当前标记的地址/方向/保存。
这是使用iframe
Google地图中的嵌入式代码完成的。但是,如何使用自定义“编码”地图来做同样的事情?
geocoder = new google.maps.Geocoder();
geocoder.geocode({
"address": nw.google_pointer
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var myOptions = {
zoom: parseInt(nw.google_zoom),
center: results[0].geometry.location,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
title: nw.google_pointer
});
} else {
console.log('Geocode was not successful for the following reason: ' + status);
}
});
背景:
对于这里和这里的鼠标滚轮滚动问题,我需要更好的解决方案。获得我想要的行为的最好方法是坚持使用API,但是我真的很喜欢嵌入式版本中显示的卡。
方法:
我的自定义:
希望这对您有用!
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句