Rap*_*con 1 javascript css google-maps google-maps-api-3
因此,我正在一个经常使用地图的项目中工作,而一项工作已经传递给我,我必须使所有这些Google Maps Markers成为可能。
然后手动输入数字:
我问是否可以通过代码来输入数字,他们说不是,需要这样。
所以,我需要知道,有一种方法可以通过javascript或css或任何可以自动执行此过程的方法来更改此数字。
It is indeed very possible - simply use the label attribute :
var marker = new google.maps.Marker({
position: new google.maps.LatLng(56.43, 10.3),
map: map,
label: '6' //<-- 6 will be the text inside the marker
});
Run Code Online (Sandbox Code Playgroud)
demo with different numbers -> http://jsfiddle.net/ec2cr0jw/
But you can only add labels with one character, so your range of numbers is limited to 0..9. If you want more complex text or longer numbers in the markers, you can create the markers yourself from scratch, like in the answer to this question -> How to add values in google map v3
| 归档时间: |
|
| 查看次数: |
954 次 |
| 最近记录: |