does the product have the function that allows user to set different labeling (font, size, position/alignment) for different features (eg points)?
This will allow users to reduce label overlaps on map for better visual impression. this is great when not so many features on map.
Thanks,
Individual Feature labeling?
Hi GuangMing,
I think custom textstyle should be hepful for your requirement.
You can try to view the "Labeling Based On Columns" online sample here. wiki.thinkgeo.com/wiki/Map_Suite_MVC_Edition_Labeling_Samples
Regards,
Don
good one: but Marker class is very different for the MVC version.
The example is desktop or wpf version: the MVC version Marker does not support Content/FontSize/… properties.
Is there any easy way to create my own MVC Marker class?
- foreach (Feature feature in features)
-
{
-
PointShape pointShape = (PointShape)feature.GetShape();
-
Marker marker = new Marker(pointShape.X, pointShape.Y);
-
marker.ImageSource = null;
-
marker.Content = feature.ColumnValues["AREANAME"];
-
marker.FontSize = 14;
-
marker.FontStyle = FontStyles.Oblique;
-
simpleMarkerOverlay.Markers.Add(marker);
-
}
Hi Guangming,
Thanks for your query, but I am sorry to say now maker could not directly implement your requirement, but attached code could be a walk around for your requirement.
if you have any more question , please feel free to let us know.
Best Regards
Summer
Post11567.txt (1.82 KB)
that is great. Questions:
How does it render a long text on the marker image? I notice that the marker image is just 21*25 pixel.
do I need to design all kinds of colors of markers? I notice that there are only couple of markers there? Ideally I would draw text any colors.
Actually, a more fundamental question: does your product allow me to catch the event when you draw label for a feature / field?
Thanks,
Guangming
Hi Guangming,
If you want to render a long text, you need to calculate its length and add “\r\n” for wrap text. And you should want to change the TextOffsetX and TextOffsetY for make it looks better.
For marker color, you can see we are using exsiting image, if you want to use many different colors, I think you can prebuild them or try creating them dynamic when app run.
Sorry we don’t have event for label drawing, it looks the MVC version use different render logic for marker.
Regards,
Don