OSM plugin

osm plugin by Michael Hamann
An OpenStreetMap Plugin

Last updated on 2008-11-10. Provides Syntax, Action.
Compatible with DokuWiki 2008-05-05.

Similar to itrackviewer, openlayersmap.

Tagged with embed, maps, media.

    This is a plugin to display maps from OpenStreetMap in your wiki. You can add as many maps as you want to one wiki page. You can add multiple markers to a map. Although it's already supported by the syntax it doesn't display any label-text for markers, but that's planned as well as well as the possibility to use any image as marker.

    Note: You shouldn't use this plugin as-is on high-volume sites but setup your own rendering server as the rendering servers of OpenStreetMap have their limits.

    Download and Installation

    Download and install the plugin using the Plugin Manager using the following URL. Refer to Plugins on how to install plugins manually.

    Usage

    As the plugin is heavily based on googlemaps the syntax is almost the same. There is only one difference, there is an additional layer parameter that can be used to determine the OpenStreetMap-renderer. There is a configuration-option to set the URL to get the static image from that is displayed when JavaScript is disabled.

    Syntax

    <osm parameter="value" parameter="value">
    lat,lon,text
    lat,lon,text
    </osm>

    The lines of “lat,lon,text” represent the individual overlay markers. Each marker must have its own line and be the only information on that line. “lat” and “lon” are the latitude and longitude of the marker. “text” is the text to be displayed in the popup when the marker is clicked. The text can include wiki markup.

    Parameters

    • width — 999px (e.g. 500px) width of the map, default is 400px.
    • height — 999px (e.g. 500px) height of the map, default is 300px.
    • lat — values: -90.0 - 90.0; latitude of map centre, negative values are south.
    • lon — values: -180.0 - 180.0; longitude of map centre, negative values are west.
    • zoom — integer, zoom level, default value 8. Valid values are between 0 and 18 (note: as the static image uses the osmarender-renderer the static image only supports zoom level 17).
    • layer — values: osmarender, maplint, mapnik. Default is mapnik. Specifies the OpenStreetMap-Renderer to be used.

    The parameters can be in any order.

    Versions

    Version 2008-11-10

    Added some validation for attributes, now all layers (maplint, osmarender, mapnik) are included and the one specified is default.

    Version 2008-10-11

    Initial version.

    Discussion

    Leave comments, suggestions, bugs here or send them by mail (see above).

    I set up three different DokuWiki installations and tried the OSM plugin. But it results the following error on each installation:

    Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /mnt/web3/33/25/51480925/htdocs/02_tha/wiki/lib/plugins/osm/syntax.php on line 76

    I think it would be a nice plugin if it would work properly.

    greetz,

    king nothing

    This is a known problem as I am using syntax that hasn't been supported before PHP 5. You can either upgrade to PHP 5 or remove that ”&” on line 76 and add
    $query_params[$key] = $val;

    after line 77. Or you just wait for the next version that will contain a real fix. — Michael Hamann 2009/02/15 20:15

     
    plugin/osm.txt · Last modified: 2009/10/07 18:44 by laynee
     
    Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
    Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
    WikiForumIRCBugsGitXRefTranslate