14.01.2013 Views

Developer's Guide - MapGuide Open Source - OSGeo

Developer's Guide - MapGuide Open Source - OSGeo

Developer's Guide - MapGuide Open Source - OSGeo

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

To change the layer visibility for a given view scale, modify the layer resource<br />

and save it back to the repository. See Modifying Maps and Layers (page 55)<br />

for details.<br />

The following example turns on the visibility for the Roads layer.<br />

$layers = $map->GetLayers();<br />

$roadsLayer = $layers->GetItem('Roads');<br />

$roadsLayer->SetVisible(True);<br />

NOTE Changing the visibility will have no effect until the map is saved and<br />

refreshed.<br />

Changing Visibility | 31

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!