ThinkGeo.com    |     Documentation    |     Premium Support

Showing higlighted features with the same symbol

I have a feature with a value-style, where each valuestyle has a custom WellPointStyle assigned to a value.

Now i want to highlight a feature when it is clicked in the map (Show it in the same way as when unselected, but with a different color). I used a MapClick-event, determined the nearest feature to the click and put in into a separate hightlight-layer. That works ok. But the style the feature is shown in does not match the style which is was shown in when not selected.

Example:
In my valuestyle i have assigned the value “A” to WellPointStyle(90,…), the value “B” to WellPointStyle(91,…)
Now when i click a feature with value “A” it is higlighted, but not with the WellPointStyle(90,…), but with the style defined in my hightlight-layer.

Question:
Is there a method to find out which style is responsible for rendering a specific feature in the current ZoomLevelset according to the zoomlevelset’s style-definition? Or do i have to “copy” the whole ZoomLevelSet from my FeatureLayer to my HighlightLayer, thereby changing the color in all styles?

Regards,
Andreas

Hi Andreas,

Currently, we do not have method to find the specific feature’s style. But you can write the logic to get the style from FeatureLayer’s ZoomLevelSet.

To highlight one feature:

  1. If you highlight with different style by features, you need to add value style to your highlight layer;
  2. If you highlight with one style for all features, you just add simple style to your highlight layer;

You said you already add the style to your highlight layer, please make sure the style applies to the right zoom level, here is sample code:

highlightLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(your highlight style);
highlightLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

Hope this is helpful for you, if you still meet this issue, please provide us a sample to recreate this issue, our developer will handle it.

Thanks,
Bill