fiddle 地图上未出现字体真棒标记
Font awesome marker not appearing on fiddle maps
我是 js 的新手fiddle,似乎无法将我的超棒字体标记放到这个 fiddle 上。有人可以告诉我问题出在哪里吗?
<div id="googleMap" style="width:500px;height:380px;"></div>
var myCenter = new google.maps.LatLng(51.508742, -0.120850);
function initialize() {
var mapProp = {
center: myCenter,
zoom: 15,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
var marker = new google.maps.Marker({
position: myCenter,
map: map,
icon: {
path: fontawesome.markers.MAP_MARKER,
scale: 0.5,
strokeWeight: 0.2,
strokeColor: '#9300D6',
strokeOpacity: 1,
fillColor: '#D69112',
fillOpacity: 1
}
});
/*var marker = new google.maps.Marker({
position: myCenter,
});*/
marker.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
我想你忘记了将 fontawesome-marker 包添加到你的 fiddle 源中。我更新了 JSFiddle 并且工作正常。
https://rawgit.com/nathan-muir/fontawesome-markers/master/fontawesome-markers.min.js
我是 js 的新手fiddle,似乎无法将我的超棒字体标记放到这个 fiddle 上。有人可以告诉我问题出在哪里吗?
<div id="googleMap" style="width:500px;height:380px;"></div>
var myCenter = new google.maps.LatLng(51.508742, -0.120850);
function initialize() {
var mapProp = {
center: myCenter,
zoom: 15,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
var marker = new google.maps.Marker({
position: myCenter,
map: map,
icon: {
path: fontawesome.markers.MAP_MARKER,
scale: 0.5,
strokeWeight: 0.2,
strokeColor: '#9300D6',
strokeOpacity: 1,
fillColor: '#D69112',
fillOpacity: 1
}
});
/*var marker = new google.maps.Marker({
position: myCenter,
});*/
marker.setMap(map);
}
google.maps.event.addDomListener(window, 'load', initialize);
我想你忘记了将 fontawesome-marker 包添加到你的 fiddle 源中。我更新了 JSFiddle 并且工作正常。
https://rawgit.com/nathan-muir/fontawesome-markers/master/fontawesome-markers.min.js