Map Layer Design Prototyping

Coordinator
Jan 6, 2009 at 9:42 AM
I've been thinking about our Layer design.  The discussion question about controlling opacity for the layer got me thinking that perhaps the Layer should be the Canvas.  I plan to explore this idea and prototype some of the possibilities this may have for simplification and setting ourselves up better for the Spatial Release.

  • Expose Layers as a collection of ILayer off the map.
  • Make Layer a Canvas rather than just Control.
  • Design GeometryLayer Updates to be configurable via properties:
    • HideOnZoom
    • UpdateFrequency
  • Synchronize Scale of Canvas with MSI Map Size.

Developer
Jan 6, 2009 at 11:52 AM
Should we make our layer a panel and use a canvas for now? That way others can use any panel they want and even create their own panel (such as a virtual canvas).
Coordinator
Jan 6, 2009 at 4:40 PM
Sure Matt.  I'll give it a shot.
Coordinator
Jan 6, 2009 at 10:31 PM
Per my code check-in comment:

GeometryLayer just got a lot more interesting:
* Moved Shape ScaleTransform logic out of Map and into GeometryLayer.
* Collapsed GeometryController into GeometryLayer.
* Made GeometryLayer a Canvas subclass
* Changed Layers to Map content property to allow Layer creation from XAML.




So the Layers are in fact Canvas subclasses now.  This simplified things greatly.  We are in much better shape now for integrating some interesting geometry stuff.  This change allows us to have better direct control on many things about a shape layer (opacity, visibility, and update patterns).  Now you can create as many or as few layers as we need depending on the number of distinct layer characteristics you need.  For example, here is how the Prototype Polygon layer is created:

                shapeLayer = new GeometryLayer(MapInstance) {ID = "POLYGONLAYER"};
                shapeLayer.HideElementsOnZoom = true;
                shapeLayer.UpdateMode = GeometryLayer.UpdateModes.ScaleTransform;

Additionally, there are some further optimizations/cleanup that can be found now that all the Geometry logic is in one place.

Developer
Jan 6, 2009 at 11:44 PM
That's great!