MediaWiki GIS Extensions: Unterschied zwischen den Versionen

GISWiki - Das freie Portal für Geoinformatik (GIS)
Wechseln zu: Navigation, Suche
(Weblinks)
 
(7 dazwischenliegende Versionen von 4 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
 +
* [[Google Maps Extensions]]
  
=Google Maps Extensions=
+
* [[GIS-Extension]]
 
+
[[Google Maps]] ist der Karten- und Routing-Service  von Google.
+
 
+
==Marker Extension==
+
 
+
===Code===
+
 
+
<pre>
+
 
+
<?php
+
 
+
# Map WikiMedia extension
+
#
+
# Uses Google Maps as a Map Server
+
#
+
# This extension displays a marker with further infos (when clicking)  on given coordinates
+
#
+
# Copy this text into a file called "hjlMap.php"
+
# To activate the extension, include it from your LocalSettings.php
+
# with: include("extensions/hjlMap.php");
+
#
+
# Use the tags <map>Latitude|Longitude|ZoomFactor|URL|URL-Text|URL-Image|Image-Height</map> to display this map.
+
#
+
# Sample: "<map>53.053|7.803|10|http://www.giswiki.org/|GISWiki|http://www.giswiki.org/skins/common/images/wiki.png\|30</map>"
+
#
+
# Missing: error-handling, ....
+
 
+
 
+
$wgExtensionFunctions[] = "wfMapExtension";
+
 
+
function wfMapExtension()
+
{
+
global $wgParser;
+
$wgParser->setHook( "Map", "renderMap" );
+
}
+
 
+
# The callback function for converting the input text to HTML output
+
function renderMap( $input )
+
{
+
 
+
$varAr = explode("|", $input);
+
 
+
$varLat   = $varAr[0];
+
$varLon   = $varAr[1];
+
$varZoom  = $varAr[2];
+
$varURL  = $varAr[3];
+
$varText  = $varAr[4];
+
$varImg  = $varAr[5];
+
$varImgH  = $varAr[6];
+
 
+
# Hint: you need to sign up for a Google Maps API key!!
+
#      http://www.google.com/apis/maps/signup.html
+
#      Then replace the key below.
+
 
+
$varInfo = "<img src=\"".$varImg."\" height=\"".$varImgH."\" width=\"".$varImgW."\"><br><a href=\"".$varURL."\" target=\"_blank\">".$varText."</a>";
+
 
+
$aMap =
+
"
+
 
+
<script>
+
// Creates a marker whose info window displays the given number
+
function createMarker(point, text) {
+
var marker = new GMarker(point);
+
var html = text + \"<br><br><font size='-1'>(&ouml;ffnet in neuem Fenster)</font>\";
+
GEvent.addListener(marker, \"click\", function() {marker.openInfoWindowHtml(html);});
+
return marker;
+
}
+
</script>
+
 
+
<script src='http://maps.google.com/maps?file=api&v=1&key=ABQIAAAAmSaaWiH-UdM6X8GKUpwrShRxST-HWBdKUWLFy_5rr1CqF7sELxRXeY9OVogKb86vpauaaMAdd8JMQQ' type='text/javascript'></script>
+
<div id='map' style='width: 500px; height: 400px'></div>
+
<script type='text/javascript'>
+
//<![CDATA[
+
var map = new GMap(document.getElementById('map'));
+
//map.addControl(new GSmallMapControl());
+
//map.addControl(new GMapTypeControl());
+
map.addControl(new GLargeMapControl());
+
map.addControl(new GMapTypeControl());
+
map.centerAndZoom(new GPoint(".$varLon.", ".$varLat."), ".$varZoom.");
+
map.setMapType(_SATELLITE_TYPE);
+
var point = new GPoint(".$varLon.",".$varLat.");
+
var marker = createMarker(point, '".$varInfo."');
+
map.addOverlay(marker);
+
</script>
+
";
+
 
+
return $aMap;
+
}
+
?>
+
 
+
 
+
 
+
</pre>
+
 
+
===Beispiel / Sample===
+
 
+
'''Eingabe / Input'''
+
 
+
<nowiki>
+
<map>53.0419921875|8.85000228881836|10|http://www.giswiki.org/|GISWiki|http://www.giswiki.org/skins/common/images/wiki.png\|30</map>
+
</nowiki>
+
 
+
'''Ergebnis / Result'''
+
 
+
<Map>53.0419921875|8.85000228881836|10|http://www.giswiki.org/|GISWiki|http://www.giswiki.org/skins/common/images/wiki.png\|30</Map>
+
 
+
 
+
 
+
 
+
 
+
==Siehe auch ==
+
 
+
* http://earth.google.com/
+
** [http://www.kartographie.uni-trier.de/p/h/users/sk/Google_Earth/google_earth_de_wikipedia.htm Artikel der deutschsprachigen Wikipedia in Google Earth visualisieren]
+
 
+
*[http://libgmail.sourceforge.net/googlemaps.html Google Maps Hacking and Bookmarklets]<br>which contains several steps on how you can customize and add information to Google Maps.
+
 
+
* There's also a pointer to http://mygmaps.com , which allows you to display custom data files with Google Maps. (The site is alphaish, so things may break.)
+
 
+
* [http://monkeyhomes.com/map/nycsubway.php New York Subway Stops on Google Maps]
+
 
+
* [http://gpswanderer.blogspot.com/2005_04_01_gpswanderer_archive.html Mobile Google Maps with GPS (not really a mashup, but nifty)]
+
 
+
* [http://www.artfahrt.com/products.html Google Maps on your TiVO]
+
 
+
* [http://www.geobloggers.com/ Geobloggers: Lat/Lon tagged Flickr photos represented on Google Maps. About 8000 photos tagged so far.]
+
 
+
* http://www.chicagocrime.org/
+
 
+
* http://www.housingmaps.com/
+
 
+
* [http://www.golem.de/0503/37128.html Google: Ortsbezogene Suche kommt nach Deutschland]
+
 
+
  
 +
* [[Koordinatentool "hjl_get_Coor"]]
  
 +
* [[QuickWMS-Extension]]
  
 +
* [[Point-Mapping Extension]]
  
 
[[Kategorie:Web Mapping]]
 
[[Kategorie:Web Mapping]]
 
[[Kategorie:Geodaten]]
 
[[Kategorie:Geodaten]]
 +
[[Kategorie:MediaWiki]]

Aktuelle Version vom 21. Januar 2006, 19:03 Uhr