RU:Simple image MediaWiki Extension

From OpenStreetMap Wiki
Jump to: navigation, search
Доступные языки — Simple image MediaWiki Extension
· Afrikaans · Alemannisch · aragonés · asturianu · azərbaycanca · Bahasa Indonesia · Bahasa Melayu · Bân-lâm-gú · Basa Jawa · Basa Sunda · Baso Minangkabau · bosanski · brezhoneg · català · čeština · corsu · dansk · Deutsch · eesti · English · español · Esperanto · estremeñu · euskara · français · Frysk · Gaeilge · Gàidhlig · galego · Hausa · hrvatski · Igbo · interlingua · Interlingue · isiXhosa · isiZulu · íslenska · italiano · Kiswahili · Kreyòl ayisyen · kréyòl gwadloupéyen · Kurdî · latviešu · Lëtzebuergesch · lietuvių · magyar · Malagasy · Malti · Nederlands · Nedersaksies · norsk bokmål · norsk nynorsk · occitan · Oromoo · oʻzbekcha/ўзбекча · Plattdüütsch · polski · português · română · shqip · slovenčina · slovenščina · Soomaaliga · suomi · svenska · Tiếng Việt · Türkçe · Vahcuengh · vèneto · Wolof · Yorùbá · Zazaki · српски / srpski · беларуская · български · қазақша · македонски · монгол · русский · тоҷикӣ · українська · Ελληνικά · Հայերեն · ქართული · नेपाली · मराठी · हिन्दी · भोजपुरी · অসমীয়া · বাংলা · ਪੰਜਾਬੀ · ગુજરાતી · ଓଡ଼ିଆ · தமிழ் · తెలుగు · ಕನ್ನಡ · മലയാളം · සිංහල · བོད་ཡིག · ไทย · မြန်မာဘာသာ · ລາວ · ភាសាខ្មែរ · ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ‎ · አማርኛ · 한국어 · 日本語 · 中文(简体)‎ · 中文(繁體)‎ · 吴语 · 粵語 · ייִדיש · עברית · اردو · العربية · پښتو · سنڌي · فارسی · ދިވެހިބަސް

This page describes a simple image MediaWiki extension. See MediaWiki extension for details of other ideas / enhancements we could develop.


The extension is now installed and running on this wiki. It simply puts a map image on the wiki page by referencing the flexible "MapOf" image generating interface created by User:Ojw.

The extension supports wiki markup of the form

<map lat="51.485" lon="-0.15" z="11" w="300" h="200" format="jpeg" />

There should be no contents placed between start and end tags <map>xxxx</map>

The syntax results in a map! :

The extension simply spits out an <IMG> tag with the src set to a URL like this one: http://dev.openstreetmap.org/~ojw/MapOf/?lat=51.485&long=-0.15&z=11&w=300&h=200&format=jpeg


Old syntax

It used to supports this old format with '|' pipe characters:

<map>lat=51.485|lon=-0.15|z=11|w=300|h=200|format=jpeg</map> 

This is no longer supported. Any pages using that will see an error

MediaWiki Versions

Harry Wood originally developed this to work on his old version 1.4 MediaWiki installation, but it has since been rewritten, and probably requires v1.6 onwards (unverified)

Installation

  • Download the three files which make up this extension. Right-click the links and do 'save as'
  • Save them into a folder called 'SimpleMap'
  • Upload this into your mediawiki installation in the 'extensions' subdirectory
  • Edit your 'LocalSettings.php' file. Add the following lines:
//openstreetmap extension 
include("extensions/SimpleMap/SimpleMap.php");
$wgMapOfServiceUrl = "http://osm-tah-cache.firefishy.com/~ojw/MapOf/?";
//$wgMapOfServiceUrl = "http://tah.openstreetmap.org/MapOf/?";
//$wgMapOfServiceUrl = "http://dev.openstreetmap.org/~ojw/MapOf/?";
  • Try it out! e.g. Stick the map syntax example above on your 'SandBox' page.

Dependency note

This introduces a dependency between your wiki and the image generating service running on the openstreetmap server. If openstreetmap ceases to provide images under these URLS (http://osm-tah-cache.firefishy.com/~ojw/MapOf/ is caching squid proxy fetching from http://tah.openstreetmap.org/MapOf/ ), for whatever reason, then your wiki will still function, but it will show image errors. The width and height of the image are specified explicitly in the output HTML, so most browsers will fetch and browse around the rest of your wiki without being slowed down by images failing to load.

We are offering no guarantees about the long-term continuation of this (or indeed any) openstreetmap service. This particular service is experimental, and may be particularly prone to down-time or being moved to a new URL. Equally the extension code may be re-written, and you should aim to use the latest code available here. e.g. for security fixes.

There are a number of limitations and things which could be enhanced. The MediaWiki extension page has lots of ideas for this.

Known Issues / ideas

  • Click takes you to the map, but perhaps it should take you to the Osmarender layer in order to see exact correspondance with the image seen in the wiki.

Who's working on it

The extension code

The code is in subversion:

http://svn.openstreetmap.org/applications/utils/wiki-extensions/SimpleMap

For more info on subversion see Getting The Source. Changes don't get deployed to the live OSM wiki server until one of the System Administrators does it (ask User:Firefishy or User:TomH). Usually though the latest code you see there should be the code running on this OpenStreetMap wiki.