I use the cornford google googlmapper package of laravel where all intelligence stays in the controller and maoa passes to the view via java script rendered, I need to insert legend in the map marker so that it looks like the example below:
The manipulation of texts in the mark is very complex and limited. I could not find a way to do this other than by using the markerwithlabel library.
Using it, just create the markwithlabel:
js:
marker = new MarkerWithLabel({
position: new google.maps.LatLng(point.Latitude, point.Longitude),
icon: icon.jpg,
labelContent: "Ponto de chegada",
labelAnchor: new google.maps.Point(62, 42),
labelClass: "my-custom-class-for-label",
map: map
});
And create the class that answers your training:
.my-custom-class-for-label {
text-align: left;
font-weight: bold;
font-size: 20px;
color: #fff;
}
Remembering that it is important that you include the same scripts in your project, you can copy this js (
Example usage: link
Text explaining usage: link