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
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=%7B$wgGoogleMapsKey%7D%..." type="$wgJsMimeType"></script>\n"; } return $r; }
Am I doing something wrong?
--Billy
On 12/4/05, Evan Miller Evan.M.Miller@williams.edu 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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
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@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org