how add text to circles and Polygons ??
hello i have this code:
figure=new nokia.maps.map.Circle(
coordinate,
coordinate.distance(coordinate2),
{
pen: {
strokeColor: "#C22A",
lineWidth: 2
},
brush: {
color: "#0FF6"
}
}
);
map.objects.add(figure);
------------------
figure=new nokia.maps.map.Polygon(myGeoStrip,
{
precision: 36,
simplify: 16,
fillColor: "#0FF6",
color: "#C22A",
width: 2
});
map.objects.add(figure);
--------------
how can i add a text in the center of each figure?
Re: how add text to circles and Polygons ??
I never seen any polygon nor circle items with any maps offerigns I have checked which would also include text in them, thus you would likely need to add additional object on the top of it. and center it to middle.
Re: how add text to circles and Polygons ??
Re: how add text to circles and Polygons ??
The key to doing this is to use SVG graphics. The SVG custom marker playground example includes a method of placing text in a circle see: [url]http://api.maps.nokia.com/en/playground/examples/maps/map_objects/customsvgmarker.html[/url]
Placing text over a polyline is a bit more tricky, however it would be possible to draw the polyline and add another SVG marker displaying text (without a background color) to a specified central geocoordinate. in other words use [B]two[/B] markers, one for
the line, one for the text.
The method for doing this is discussed here: [url]http://www.developer.nokia.com/Community/Discussion/showthread.php?236601-Text-on-Marker[/url] - the example uses a [B]StandardMarker[/B], but any [B]MapObject [/B]with a [B]zIndex [/B]could be used.
Re: how add text to circles and Polygons ??