我需要在我的网站中将自定义图片显示为位置标记。
我附上图片。Image
答案 0 :(得分:0)
HTML
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap">
//append jquery map marker js
<div id="googlemaps"></div>
脚本
var mapMarkers = {
"markers":
[
{
"latitude": "48.85661",
"longitude":"2.35222",
"icon": "../wp-content/uploads/2016/08/pin.png"
}
]
};
$("#googlemaps").mapmarker
({
zoom : 16,
center : "48.85661, 2.35222",
dragging : 1,
mousewheel : 0,
markers : mapMarkers,
featureType : "all",
visibility : "on",
elementType : "geometry"
});