简体   繁体   English

如何设置原始网站上显示的google-maps标记

[英]How to set the google-maps marker as it is showed on the original website

Try to Search the first address on google maps, and click on it : 尝试在Google地图上搜索第一个地址,然后单击它:

it will show us a marker with a photo (if avaiable), description, and some links. 它将向我们显示一个带有照片(如果有),描述和一些链接的标记。 I'd like to add the same marker in my web application. 我想在我的Web应用程序中添加相同的标记。

Which API I need to use? 我需要使用哪个API? At the moment I just make my own string and append it : 此刻,我只是创建自己的字符串并将其附加:

var finestra='';
finestra += '<div style="position:relative;width:200px;">';
finestra += '<div style="position:relative;float:left; color:#000000;" class=canale>';
finestra += 'Archimede<br />Via Brennero,12<br />38100 Trento(TN)<br />c.+39 555555555';
finestra += '</div>';
finestra += '</div>';

var marker = createMarker(map.getCenter());
map.setCenter(new GLatLng(46.084989,11.118851), 16, G_NORMAL_MAP);
map.addOverlay(marker);
marker.openInfoWindowHtml(finestra);    

But I need the same marker as google maps show on the original website. 但是我需要与原始网站上显示的google地图相同的标记。 Is it possible? 可能吗?

You need to use a custom overlay . 您需要使用自定义叠加层 Here is an example: custom marker 这是一个示例: 自定义标记

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM