I have been going through the documentation of GeoMarker
.
But I do not see any way to add text to these GeoMarker
s. I would like to number them, is there anyway to do this?
I have been going through the documentation of GeoMarker
.
But I do not see any way to add text to these GeoMarker
s. I would like to number them, is there anyway to do this?
If you want to add a custom value to your GeoMarker you can do as follows:
cities = {Entity["City", {"Rome", "Lazio", "Italy"}],
Entity["City", {"Padova", "Veneto", "Italy"}],
Entity["City", {"Palermo", "Sicily", "Italy"}]};
GeoGraphics[{GeoStyling["OutlineMap"], Polygon[Entity["Country", "Italy"]],
MapThread[{GeoMarker[#1], White,
Text[Style[#2, Bold], #1, {0, -2.5}]} &, {cities, {"10", "45",
"120"}}]}]
You can use Text
and its third argument to place the label in the correct position.
cities = {Entity["City", {"Rome", "Lazio", "Italy"}],
Entity["City", {"Padova", "Veneto", "Italy"}],
Entity["City", {"Palermo", "Sicily", "Italy"}]};
GeoGraphics[{GeoStyling["OutlineMap"],
Polygon[Entity["Country", "Italy"]],
MapIndexed[{GeoMarker[#1], White, Text[Style[First[#2], Bold], #1, {0, -2.5}]} &, cities]}]
Text
with aGeoPosition
, which could be the position of the marker with a small offset. Please see my comment here or the answer here. $\endgroup$