source: subversion/applications/utils/wiki-extensions/SimpleMap/SimpleMap.php @ 18339

Last change on this file since 18339 was 13914, checked in by harrywood, 11 years ago

try again. get files in right place

  • Property svn:executable set to *
File size: 2.7 KB
Line 
1<?php
2# OpenStreetMap Simple Map - MediaWiki extension
3#
4# This defines what happens when <map> tag is placed in the wikitext
5#
6# We show a map based on the lat/lon/zoom data passed in. This extension brings in
7# image generated by the static map image service called 'GetMap' maintained by OJW. 
8#
9# Usage example:
10# <map lat=51.485 lon=-0.15 z=11 w=300 h=200 format=jpeg />
11#
12# Images are not cached local to the wiki.
13# To acheive this (remove the OSM dependency) you might set up a squid proxy,
14# and modify the requests URLs here accordingly.
15#
16##################################################################################
17#
18# Copyright 2008 Harry Wood, Jens Frank, Grant Slater, Raymond Spekking and others
19#
20# This program is free software; you can redistribute it and/or modify
21# it under the terms of the GNU General Public License as published by
22# the Free Software Foundation; either version 2 of the License, or
23# (at your option) any later version.
24#
25# This program is distributed in the hope that it will be useful,
26# but WITHOUT ANY WARRANTY; without even the implied warranty of
27# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28# GNU General Public License for more details.
29#
30# You should have received a copy of the GNU General Public License
31# along with this program; if not, write to the Free Software
32# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
33#
34# @addtogroup Extensions
35#
36
37
38if( defined( 'MEDIAWIKI' ) ) {
39        $wgExtensionFunctions[] = 'wfsimplemap';
40
41        $wgExtensionCredits['parserhook'][] = array(
42                'name'           => 'OpenStreetMap Simple Map',
43                'author'         => '[http://harrywood.co.uk Harry Wood], Jens Frank',
44                'svn-date'       => '$LastChangedDate: 2008-07-23 22:20:05 +0100 (Wed, 23 Jul 2008) $',
45                'svn-revision'   => '$LastChangedRevision: 37977 $',
46                'url'            => 'http://wiki.openstreetmap.org/wiki/Simple_image_MediaWiki_Extension',
47                'description'    => 'Allows the use of the <tt><nowiki>&lt;map&gt;</nowiki></tt> tag to display a static map image. Maps are from [http://openstreetmap.org openstreetmap.org]',
48                'descriptionmsg' => 'simplemap_desc',
49        );
50
51        $wgAutoloadClasses['SimpleMap'] = dirname( __FILE__ ) . '/SimpleMap.class.php';
52        $wgExtensionMessagesFiles['SimpleMap'] = dirname( __FILE__ ) . "/SimpleMap.i18n.php";
53       
54        function wfsimplemap() {
55                global $wgParser, $wgMapOfServiceUrl;
56                # register the extension with the WikiText parser
57                # the first parameter is the name of the new tag.
58                # In this case it defines the tag <map> ... </map>
59                # the second parameter is the callback function for
60                # processing the text between the tags
61                $wgParser->setHook( 'map', array( 'SimpleMap', 'parse' ) );
62                $wgMapOfServiceUrl = "http://osm-tah-cache.firefishy.com/~ojw/MapOf/?";
63        }
64
65}
Note: See TracBrowser for help on using the repository browser.