Changes between Version 49 and Version 50 of MigrationGuide5.x


Ignore:
Timestamp:
2022-01-28T14:36:48-04:00 (2 years ago)
Author:
Jeff McKenna
Comment:

add get metadata example

Legend:

Unmodified
Added
Removed
Modified
  • MigrationGuide5.x

    v49 v50  
    2828  * setOpacity() example: [[SWIGMapScriptOpacity|MS4W 5.x]]
    2929* ''quickmap.php'' has also been updated (see locally at ''/ms4w/Apache/htdocs/quickmap.php'')
    30 * be aware that with the !MapServer 8 release, many '''deprecated''' things have been removed and will now throw an error.  For example, there is no longer a ''setMetaData()'' function for a Layer, in [[https://mapserver.org/mapscript/mapscript.html|SWIG MapScript]].  Instead we must access the 'metadata' hashTableObj keys and values directly, here is a working example:
     30* be aware that with the !MapServer 8 release, many '''deprecated''' things have been removed and will now throw an error.  For example, there is no longer a ''setMetaData()'' function for a Layer (or ''getMetaData()''), in [[https://mapserver.org/mapscript/mapscript.html|SWIG MapScript]].  Instead we must access the 'metadata' hashTableObj keys and values directly, here is a working example:
    3131  {{{
    3232    #!php
    3333    <?php
     34      //set metadata using the new 'metadata' hashTableObj keys and value directly
    3435      $oWMSLayer->metadata->set("wms_name", "popplace");
     36      $oWMSLayer->metadata->set("wms_title", "Cities");
    3537      $oWMSLayer->metadata->set("wms_srs", "EPSG:3978");
    3638      $oWMSLayer->metadata->set("wms_server_version", "1.1.1");
    3739      $oWMSLayer->metadata->set("wms_format", "image/png");
     40      //get metadata using the new 'metadata' hashTableObj keys directly
     41      echo $oWMSLayer->metadata->get("wms_title");
    3842    ?>
    3943  }}}