admin管理员组

文章数量:1404615

so, i'm working on a project that uses maps a lot, and a job was passed to me, I have to make all this google maps Markers.

And put NUMBERS MANUALLY:

I asked if its possible to put the numbers by code, they say that is not, this need to be done this way.

So, i need to know, there is a way of changing this numbers by javascript or css or anything that could automatize this process.

so, i'm working on a project that uses maps a lot, and a job was passed to me, I have to make all this google maps Markers.

And put NUMBERS MANUALLY:

I asked if its possible to put the numbers by code, they say that is not, this need to be done this way.

So, i need to know, there is a way of changing this numbers by javascript or css or anything that could automatize this process.

Share Improve this question edited Nov 5, 2015 at 14:40 geocodezip 161k14 gold badges226 silver badges254 bronze badges asked Nov 5, 2015 at 11:27 Raphael MayconRaphael Maycon 732 silver badges9 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

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
}); 

demo with different numbers -> http://jsfiddle/ec2cr0jw/

But you can only add labels with one character, so your range of numbers is limited to 0..9. If you want more plex 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

本文标签: javascriptGoogle Maps Markers with numbersStack Overflow