Changes between Version 1 and Version 2 of CodeSamples/PHP/AddLayerToInitialMap


Ignore:
Timestamp:
Sep 5, 2008 2:11:12 AM (9 years ago)
Author:
gingerbbm
Comment:

Slight reformat

Legend:

Unmodified
Added
Removed
Modified
  • CodeSamples/PHP/AddLayerToInitialMap

    v1 v2  
    55== Dynamically adding a layer to the initial map ==
    66The following script shows how to create a temporary !MapDefinition and insert a layer that is visible when the map loads.
    7 It can also be modified to toggle a layers initial visibility.
     7It can also be modified to toggle a layer's initial visibility.
    88
    99== Things to note ==
     
    3636// Create the MapLayer XML nodeset in the first position
    3737$targetNode = $mdDomDoc->getElementsByTagName("MapLayer")->item(0);
    38 $newNode = $targetNode->parentNode->insertBefore(new DOMElement("MapLayer"),
    39 $targetNode);
     38$newNode = $targetNode->parentNode->insertBefore(new DOMElement("MapLayer"), $targetNode);
    4039$newNode->appendChild($mdDomDoc->createElement("Name", $layerName));
    41 $newNode->appendChild($mdDomDoc->createElement("ResourceId",
    42 $rlLayerResourceId));
     40$newNode->appendChild($mdDomDoc->createElement("ResourceId", $rlLayerResourceId));
    4341$newNode->appendChild($mdDomDoc->createElement("Selectable", "false"));
    4442$newNode->appendChild($mdDomDoc->createElement("ShowInLegend", "false"));