Hi,
Does anybody know the code for drawing a ShapeFileFeatureLayer with a predefined colour scheme such as linecolor="FF3300" and Display fillcolor="FFFF66", as well as line size=1, label size=12, font="Arial" color="CC9966" outlinecolor="FFFFFF"?
Hi,
Does anybody know the code for drawing a ShapeFileFeatureLayer with a predefined colour scheme such as linecolor="FF3300" and Display fillcolor="FFFF66", as well as line size=1, label size=12, font="Arial" color="CC9966" outlinecolor="FFFFFF"?
Franklin,
I am not very sure what’s your requirement, basically we provide four kinds of predefined styles, they use for AreaStyle, LineStyle, PointStyle and TextStyle, if they’re not meet your requirement, you can create a instance of Style and set properties by just a few lines of code.
From you list, I think you will use AreaStyle, LineStyle and TextStyle.
Thanks,
James
James,
I encounter a problem in using LineStyles which I used in the attached code to display a number of shape files. The problem is only the "name" labels of mylandBaseRegion appears. The "name" labels for other ShapeFileFeatureLayers cannot be shown, although I can prove their existence in MapSuite explorer. Could you take a look at the code and point out any mistakes there? I would like to dictate the color of LineStyle according to linecolor value above but don't know how to code it in ThinkGeo. In your reply, Style was mentioned. How would you define a customer Style to make use of the color code and display its associated segment labels?
loadMapToDisplay.txt (7.93 KB)
Franklin,
Your code looks all right and should be the same way as MapSuite explorer, only difference might you set DrawingMarginPercentage, could you remove them and try it again? Without shp files data, I can not debug your sample code, so I just guess what happened.
Thanks,
James
James,
I had done this correctly before. So referring to old codes makes me realize the problem in my present code is that all the labels for a specific shape file must be placed in a new ShapeFileFeatureLayer by using CustomStyles(TextStyle…("NAME")). Do this for each shape file layer and add the label layer to staticOverlay.Layers In this way, all the labels will turn up accordingly.
Franklin
James,
The morale of this topic is trying to find a way of loading all the map shape files automatically by reading an xml file in which I have the colour scheme and shape file name. But I don’t know enough how to put the color code in the syntax of MapSuite lineStyle or other alternative.
Franklin
Franklin,
If you have two styles(LineStyle and TextStyle) that you want to apply to a FeatureLayer, you can either put them to CustomStyles or set DefaultLineStyle and DefaultTextStyle, but you can’t put one to CustomStyles and set another one to default.
So I think your problem is not like you said, we will do some research to figure out what exactly happened.
Thanks,
James
Franklin,
I got your meaning eventually, we provide API to implement your requirement, your string is not standard that you need to add "#" as prefix. For example GeoColor.FromHtml("#FFFF66")
Thanks,
James
James,
I am in the process of writing a Maploader. Then a weird thing happens. I am pretty sure about how to show the map drawing and the labels according to a shape file I saved in a directory. I used exactly the same method in WpfMap_loaded, exactly the same code, same shape file. But no lines appear on the wpfMap1 except the labels. But the same piece of code works in WpfMap_loaded of the project I mentioned above.
This is quite unexpected!
Franklin
Franklin,
Yes, it's weired. Hope you can solve your problem soon.
Expect your good news.
Thanks,
James