Error Label on Map

Topics: SharpMap Project, SharpMap v0.9 / v1.x, Web Controls
Sep 1, 2011 at 12:41 AM

SharpMap 0.8 Web controls

1. I have a base country map. On top of that I want to load  several state maps each from individual shape files.
If I cannot find a shape file, is it possible to put out a label "Shapefile not loaded" on the state? Location where to put the label can be got from the Country map.

2. Can I load all state maps on a single layer? OR Will it be better if I have an array of layers & load each state into its own layer? 
Considering that I have to select polygons on each state & save it to SQL, from the programming stand of point which will be a better approach.

Coordinator
Sep 2, 2011 at 7:49 PM

1.) If you use a custom theme you can easily query whether the shapefile is present and proceed with usual labeling, otherwise print your file not found error message

2.) If you use a layergroup for the state layers the query command will be passed to the underlying layers - I think. If not that can be established without a lot of work. You may want to modify your results so you know which state layer the features come from.

Hth FObermaier

Sep 5, 2011 at 3:51 AM
Edited Sep 7, 2011 at 6:35 AM
fobermaier wrote:

1.) If you use a custom theme you can easily query whether the shapefile is present and proceed with usual labeling, otherwise print your file not found error message

Hth FObermaier

Right now, what I am doing is loading the country layer as a Label Layer & put out the state names. 
On top of this, I will load up individual State files. Some States have mutiple files & some have single files. 
Each state has its own Layergroup. Each layergroup may have single or mutile layers depending on how many files each Stae has. Each layer in the Layergroup is identified by a Layer Type (Layer Type A, B, C). User selects the LayerType (A, B, C). 
When a State does not have the selected LayerType, I wanted to put out a lable on that state, that it lacks that feature.

It will be nice if the error label in on the State so user does not keep on clicking on the State without the Selected Layer Type.

When user does click on a State with the selected Layer Type, I fetch the intersecting Polygon & save it.

Which this explanation, can you explain how I can use "custom theme" to achieve the above funtionality.