Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I create an object derived from BaseCustomLayer which draws a polyline.
I call Map.addLayer(myBaseCustomLayer) and the function

public override void Draw(esriDrawPhase drawPhase, IDisplay Display, ITrackCancel trackCancel)

is hit. BUT if I set DynamicMapEnabled = true the draw function is not hit !

This is driving me crazy. Thanks for any hints.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

alt text

Here's my understanding, based on this illustration from the documentation:

When the map is put into dynamic mode, a background image is created. Any "non dynamic" layers (those that don't implement IDynamicLayer) are drawn to a cache and used as a background image. OpenGL is used to quickly draw display lists on top of this background image. Therefore, I would only expect ILayer.Draw for a custom layer to be called once - when the dynamicdisplay mode starts.

share|improve this answer
    
Let's say you wanted to draw a triangle to the map and then have something move around the screen, what's the correct way to do this? I turned off dynamic, drew a basicLayer which drew a polyline -> turned on dynamic -> and then drew a glyph but my line disappeared. It looks like I need to create my own custom Raster layer and have that turn into the background layer... And I guess BaseCustomLayer must not be a raster layer then... ? –  patrick Sep 2 '10 at 19:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.