My site will utilize a drop down menu containing various layer configurations, or maps. When the map is chosen, all layers are cleared from the Map Viewer and a new set of layers are inserted. The Map Viewer is cleared as follows.:
GeoMap.StaticOverlay.Layers.Clear() GeoMap.StaticOverlay.Redraw()
Up to this point, maps have functioned as expected with one problem. Any layer that uses a regular expression style can not be loaded in subsequent maps. For instance, I have 3 map choices in the drop down. The default map, map1, has 2 layers that use reg ex. These layers are also common across the 3 maps, so the layers are deleted from the Map Viewer per the above code and are re-added as if they are any other layer.
When these layers are 'drawn' in map2 or map3, however, Inside the map viewer the following error is visible:
'Object reference not set to an instance of an object.'
I assume this is a bug and has something to do with the way reg ex styles are applied to layers internally. If the layer is shut off, the map draws fine. Also, if the layer is at a zoom level where it does not draw, everything is fine also. This is only occuring with RegEx layers at this time but I have not experimented with the thematic layers yet so I am unsure about that.
Can this be confirmed or denied as a bug?
Thanks.
Edit: After adding ValueStyles to my layers to try to see if the issue was related to RegEx Styles or all CustomStyles, the ValueStyles worked correctly and as expected. This issue seems to be specific to the RegEx Styles.