ThinkGeo.com    |     Documentation    |     Premium Support

PointMarkerStyle blocks MapClick event?

I created a PointMarkerStyle with PNG image and set the style in CustomMarkerStyle in ZoomLevelSet. The image shows on map correctly. But there is no MapClick event occurs when I click on the image on the map. However, MapClick event always occurs when clicking on images in other PointStyle.
I believe PointMarkerStyle blocks MapClick event. Is this a bug or I did something wrong?
Please help!
Mengbo

Hi Mengbo,

The marker is a control which will prevent the MapClick event if click on the marker. There is an option to do this by binding the marker click event.

Attached is a sample shows how to create a custom class is derived from SimpleMarkerOverlay.

ClickableMarkerOverlay.cs (642 Bytes)

Hope it’s helped.

Thanks,
Peter

Hi Peter,

Your ClickableMarkerOverlay sample code works perfectly. You are so smart and nice. Thank you so much for your quick help.

You helped me four months ago. Last time, for animation icon with GIF images, you created animation classes based on Marker class and PointMarkerStyle class. And your animation classes work greatly for my application needs.

Now I need animation icons in LayerOverlay. Do you have sample code for animation classes based on PointStyle or PointBaseStyle?

Thank you again and have a good night,

Mengbo

Hi Mengbo,

Very glad to hear it’s helpful.
Sorry I don’t clear the requirement for animation icons in LayerOverlay. Do you mean that the points’ style change dynamically? If so please try the following steps:

  1. Create a new Layer for the points need to be styled dynamically.
  2. Add the Layer created in #1 to a LayerOverlay.
  3. Set a timer to change the PointStyle and then refresh the LayerOverlay created in #2.

If something misunderstood here, please let us know.

Thanks,
Peter

Hi Peter,

Your understanding is correct. Yes, I want that point symbols (or images) in the Layer are flashing automatically as animation effect.

I tried your timer idea and it works. But this method takes a lot of CPU time than GIF animation method takes (you gave to me four months ago). The GIF animation method creates AnimationMarker class based on Mark class that is inherited from Control. The AnimationMarker uses System ImageAnimator to animate image frames. This method looks taking much less CPU time.

Is there a way to use System ImageAnimator to animate image frames in PointStyle class?

Thank you very much,

Mengbo

Hi Mengbo,

Currently, I don’t find a way to use ImageAnimator to animate image in PointStyle. As we know the PointStyle draws the points on the bitmap which is rendered in Map and not like the marker is a control. So it’s necessary for us to refresh the overlay(bitmap) if we want to refresh the style of points.

I guess we can try rendering the points as markers, in this case we can use the AnimationMarker to change the points dynamically.

Hope it’s helpful.

Thanks,
Peter

Hi Peter,

Now I understood why you suggested using timer to refresh Layer Overlay. Then I tried your new idea rendering the points as markers and it works well.

You have done a lot of great jobs in helping me. Thank you so much and have a great day.

Mengbo

Hi Mengbo,

It’s my pleasure.

Thanks,
Peter