extent of ShapeDataLayer layer

9/24/2014 10:23:04 AM
Total Posts 2

extent of ShapeDataLayer layer



i am selecting shapes from database using ShapeDataLayer method which i have to set the extent for. but me problem is how to figure out the extent for the shape i am selecting from database in order to set the extent for the layer ??

i used to use AddShapeDataLayer function from old ASPMAP versions but it seems i can not use it anymore so does anyone have any idea what should i do to set the extent or can i use something else to select the shapes from database??


9/24/2014 2:12:21 PM
Total Posts 329

Re: extent of ShapeDataLayer layer

As described in the documentation:

By default, the extent of database layers is set to (-180,90,180,-90) (units are decimal degrees). The coordinate system is set to WGS 1984 (EPSG/SRID code is 4326).

If only database layers are added - the extent should be set, otherwise the layers will not visible.
If the layer is added only to query for the shapes inside the layer, you do not need to set the extent, and it is better to use the Layer.Open method for this purpose.

Regarding the old AddShapeDataLayer method, it is obsolete but still is supported. If the AddShapeDataLayer is used, the extent also must be set (the Map.FullExtent method was used in the previous versions for this purpose).