Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

yet another google maps extension

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


Evan.M.Miller at williams

Dec 4, 2005, 12:50 PM

Post #1 of 3 (6375 views)
Permalink
yet another google maps extension

Hello,

Google offers an open API for displaying custom information on their
highly usable map application. This API seems suitable for wikis,
which is why there are already three MediaWiki extensions for Google
Maps. But these extensions seemed a bit too rigid for me, needing
database modifications and RSS feeds and the like just to display
markers. So I wrote a simple Google Maps extension: to create a map
with many labeled markers, you just describe one marker per line with
the format "latitude,longitude,label", and put all of these markers
inside of a <googlemap> tag. A neat feature is that the marker labels
will render wiki formatting. Because of its flexibility, I think this
extension will prove useful in a wide variety of projects; I
encourage you to try it out and send me feedback.

http://meta.wikimedia.org/wiki/User:Emiller/GoogleMapsExtension

Evan Miller
Attachments: PGP.sig (0.18 KB)


wrcovington at gmail

Dec 4, 2005, 7:12 PM

Post #2 of 3 (6144 views)
Permalink
Re: yet another google maps extension [In reply to]

This is awesome! Although, I'm having some trouble. I've done the
change to LocalSettings.php, and added GoogleMaps.php to the
extensions folder. However, when I add the changes to Skin.php, I get
this error:

Parse error: parse error, unexpected $ in
/home/content/t/h/e/thesteeps/html/singletrackwiki/includes/Skin.php
on line 1348

Here is what that section in Skin.php used to look like before my changes:


function getHeadScripts() {
global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs, $wgJsMimeType;
$r = "<script type=\"{$wgJsMimeType}\"
src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
if( $wgAllowUserJs && $wgUser->isLoggedIn() ) {
$userpage = $wgUser->getUserPage();
$userjs = htmlspecialchars( $this->makeUrl(
$userpage->getPrefixedText().'/'.$this->getSkinName().'.js',
'action=raw&ctype='.$wgJsMimeType));
$r .= '<script type="'.$wgJsMimeType.'" src="'.$userjs."\"></script>\n";
}
return $r;
}


and here is what it looks like after my changes:

function getHeadScripts() {
global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs,
$wgJsMimeType, $wgScriptPath, $wgRequest, $wgGoogleMapsKey;
$r = "<script type=\"{$wgJsMimeType}\"
src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
if( $wgAllowUserJs && $wgUser->isLoggedIn() ) {
$userpage = $wgUser->getUserPage();
$userjs = htmlspecialchars( $this->makeUrl(
$userpage->getPrefixedText().'/'.$this->getSkinName().'.js',
'action=raw&ctype='.$wgJsMimeType));
$r .= '<script type="'.$wgJsMimeType.'" src="'.$userjs."\"></script>\n";
if (preg_match("/index\.php\//", $wgRequest->getRequestURL())) {
$r .= "<script
src=\"http://maps.google.com/maps?file=api&v=1&key={$wgGoogleMapsKey}\"
type=\"$wgJsMimeType\"></script>\n";
}
return $r;
}


Am I doing something wrong?


--Billy

On 12/4/05, Evan Miller <Evan.M.Miller [at] williams> wrote:
> Hello,
>
> Google offers an open API for displaying custom information on their
> highly usable map application. This API seems suitable for wikis,
> which is why there are already three MediaWiki extensions for Google
> Maps. But these extensions seemed a bit too rigid for me, needing
> database modifications and RSS feeds and the like just to display
> markers. So I wrote a simple Google Maps extension: to create a map
> with many labeled markers, you just describe one marker per line with
> the format "latitude,longitude,label", and put all of these markers
> inside of a <googlemap> tag. A neat feature is that the marker labels
> will render wiki formatting. Because of its flexibility, I think this
> extension will prove useful in a wide variety of projects; I
> encourage you to try it out and send me feedback.
>
> http://meta.wikimedia.org/wiki/User:Emiller/GoogleMapsExtension
>
> Evan Miller
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] Wikimedia
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>
>
>
>
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] Wikimedia
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l


Evan.M.Miller at williams

Dec 9, 2005, 1:57 PM

Post #3 of 3 (6099 views)
Permalink
Re: yet another google maps extension [In reply to]

Thanks for the feedback and bug reports, for those who sent them. If
you had trouble getting this maps extension (or even the example) to
work before, I encourage you to try out the new version: http://
meta.wikimedia.org/wiki/User:Emiller/GoogleMapsExtension

This version has been tested with pretty much every Google Maps-
capable browser, and it offers the sysadmin the ability to define
default map parameters for the local wiki. Let me know if you like it!

Evan

On Dec 4, 2005, at 3:50 PM, Evan Miller wrote:

> Hello,
>
> Google offers an open API for displaying custom information on
> their highly usable map application. This API seems suitable for
> wikis, which is why there are already three MediaWiki extensions
> for Google Maps. But these extensions seemed a bit too rigid for
> me, needing database modifications and RSS feeds and the like just
> to display markers. So I wrote a simple Google Maps extension: to
> create a map with many labeled markers, you just describe one
> marker per line with the format "latitude,longitude,label", and put
> all of these markers inside of a <googlemap> tag. A neat feature is
> that the marker labels will render wiki formatting. Because of its
> flexibility, I think this extension will prove useful in a wide
> variety of projects; I encourage you to try it out and send me
> feedback.
>
> http://meta.wikimedia.org/wiki/User:Emiller/GoogleMapsExtension
>
> Evan Miller
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] Wikimedia
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Attachments: PGP.sig (0.18 KB)

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.