Blinking Marker

Dec 1, 2014 at 11:42 AM
Hi Team,
I need to be create a marker having a feature of blinking as i can make that blinking operation On or OFF for particular markers (Means Conditional).


Regards,
sgoyal.
Coordinator
Dec 1, 2014 at 8:10 PM
I'd try to solve this with a custom tool for MapBox control
  • Give the tool access to the layer that contains the features that are supposed to blink.
    Render the contents in blinking symbology to a bitmap, don't forget to make the background trasparent.
  • Add a timer to the control, on every tick, call MapBox.Refersh
  • Subscribe to MapBox.MapRefreshed event, every other event paint the prerendered image on top of the map.
Note: you need to keep track of viewport and/or size changes and adjust your blinkimage accordingly
Editor
Dec 5, 2014 at 10:17 AM
I have implemented a similar thing in sharpmap.

you need a refreshtimer ticks every second or so. you also need a bool property on your objects called something like "ShowBlink" or something.

On timer tick you invert the ShowBlink property on your objects, and trigger a map refresh.

I would recommend that you do not flash more frequently than 2 seconds, unless you have very few objects. The more objects you have, the long it will take to draw, so the longer the flash delay will need to be.

I would also recommend putting your flashing icons in the variable layers collection and call TouchTimer on timer tick rather than refrehsing the whole map. this will make it much smoother.
Dec 6, 2014 at 3:59 AM

Is this possible to refresh a particular layer instead of refreshing whole map...

Editor
Dec 8, 2014 at 10:53 AM
You can kind of do this by using variable layers collection. This collection is rendered independantly of the other layers, which is why it is more performant. The only issue is that the variable layers are always drawn on top of all other layers. This is ok if you are doing something like tracking where you typically have point icons moving around the map, but not so good if you have large polygons which may cover and obscure large areas of the map.

But to answer your question, you cannot refresh just a single layer on the map. Everytime you call refresh, the whole map is rendered.