Developer's Guide - MapGuide Open Source - OSGeo
Developer's Guide - MapGuide Open Source - OSGeo
Developer's Guide - MapGuide Open Source - OSGeo
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Overview of Layers<br />
Layers represent vector data, raster data, and drawing data in a map. Each type<br />
of layer has unique characteristics.<br />
NOTE The word layer has different meanings in different contexts. A layer can<br />
refer to the layer definition in the resource repository, and it can also refer to the<br />
map layer. For the purposes of the Web Tier, a layer refers to a map layer, and a<br />
layer definition refers to the layer definition in the resource repository.<br />
Basic Layer Properties<br />
Layer Groups<br />
A map contains one or more layers (MgLayer objects) that are rendered to<br />
create a composite image. Each layer has properties that determine how it<br />
displays in the map and map legend. Some of the properties are:<br />
■ Layer name: A unique identifier<br />
■ Legend label: The label for the layer as it appears in the map legend.<br />
■ Visibility: whether the layer should be displayed in the map. Note that<br />
actual visibility is dependent on more than just the visibility setting for a<br />
layer. See Layer Visibility (page 26) for further details.<br />
■ Selectable: Whether features in the layer are selectable. This only applies<br />
to layers containing feature data.<br />
The MgMap::GetLayers() method returns an MgLayerCollection object that<br />
contains all the layers in the map. The MgLayerCollection::GetItem() method<br />
returns an individual MgLayer object, by either index number in the collection<br />
or layer name.<br />
Layers in the collection are sorted by drawing order, with the top layers at the<br />
beginning of the collection. For example, using PHP syntax, if $layers is a<br />
collection containing the layers in a map, then $layers->GetItem(0) returns<br />
the top-most layer.<br />
Layers can be optionally grouped into layer groups. Layers in the same group<br />
are displayed together in the legend.<br />
24 | Chapter 2 Interacting With Layers