How to create and add a custom map frame on top of the background map

After defining the GIS Interface manager, setting the properties and adding the interface manager object to the canvas, you can create some custom map frames and add them to the background map. Creating the map frames works only after the MainWindow_Loaded method.

Use the method:

BackgroundMapLayer.Instance.AddMapFrame(p1, p2);

Where p1 is a screen point representing the first corner of the map frame, and p2 is another screen point representing the other corner. The contents of the map frame will be the area which is covered by the map frame.

For example, When the application is loading:

GisInterfaceMgr bgm = GisInterfaceMgr.Instance;

// Background map is Alberta
bgm.setBackgroundMapLocation(-119.9, 59.9, -110.1, 49.0);


In a later stage:

Point p1 = new Point(300, 300);
Point p2 = new Point(500, 500);
BackgroundMapLayer.Instance.AddMapFrame(p1, p2);

Last edited Jul 5, 2011 at 2:09 AM by ealafselim, version 3


No comments yet.