|
|
(54 dazwischenliegende Versionen von 11 Benutzern werden nicht angezeigt) |
Zeile 1: |
Zeile 1: |
− | =Google Maps Extensions=
| + | * [[Google Maps Extensions]] |
| | | |
− | [[Google Maps]] ist der Karten- und Routing-Servive von Goggle. | + | * [[GIS-Extension]] |
| | | |
− | ==Infofenster-Extension ==
| + | * [[Koordinatentool "hjl_get_Coor"]] |
| | | |
− | ===Code===
| + | * [[QuickWMS-Extension]] |
− | <pre>
| + | |
− | | + | |
− | <?php
| + | |
− | | + | |
− | # Google Map WikiMedia extension
| + | |
− | # Copy this text into a file called "hjlGoogleMap.php"
| + | |
− | # To activate the extension, include it from your LocalSettings.php
| + | |
− | # with: include("extensions/hjlGoogleMap.php");
| + | |
− | #
| + | |
− | # Use the tags <GoogleMap>Latitude|Longitude|ZoomFactor|InfoText<GoogleMap> to display this map.
| + | |
− | #
| + | |
− | # Sample: "<GoogleMap>7.803|53.053|10|GISWiki got a GoogleMap</GoogleMap>"
| + | |
− | #
| + | |
− | # Missing: error-handling, ....
| + | |
− | | + | |
− | function wfGoogleMapExtension()
| + | |
− | {
| + | |
− | global $wgParser;
| + | |
− | $wgParser->setHook( "GoogleMap", "renderGoogleMap" );
| + | |
− | }
| + | |
− | | + | |
− | # The callback function for converting the input text to HTML output
| + | |
− | function renderGoogleMap( $input )
| + | |
− | {
| + | |
− | | + | |
− | $varAr = explode("|", $input);
| + | |
− | | + | |
− | $varLat = $varAr[0];
| + | |
− | $varLon = $varAr[1];
| + | |
− | $varZoom= $varAr[2];
| + | |
− | $varInfo = $varAr[3];
| + | |
− | | + | |
− | # 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.
| + | |
− | | + | |
− | $aMap =
| + | |
− | "
| + | |
− | <script src='http://maps.google.com/maps?file=api&v=1&key=ABQIAAAAtThFd25f3RSm_Uyo-qMHZhSEt_GnVgvWmIxz4pFM1BN9jZGypxTTPP-dRrFjQMULBxRQCp9iRU2O2w' 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(".$varLat.", ".$varLon."), ".$varZoom.");
| + | |
− | map.setMapType(_SATELLITE_TYPE);
| + | |
− | map.openInfoWindow(map.getCenterLatLng(),
| + | |
− | document.createTextNode('".$varInfo."'));
| + | |
− | </script>
| + | |
− | ";
| + | |
− | | + | |
− | return $aMap;
| + | |
− | }
| + | |
− | ?>
| + | |
− | | + | |
− | | + | |
− | </pre>
| + | |
− | | + | |
− | === Beispiel ===
| + | |
− | | + | |
− | '''Eingabe'''
| + | |
− | | + | |
− | <nowiki>
| + | |
− | <GoogleMap>8.85000228881836|53.0419921875|10|GISWiki got a GoogleMap</GoogleMap>
| + | |
− | </nowiki>
| + | |
− | | + | |
− | '''Ergebnis'''
| + | |
− | | + | |
− | <GoogleMap>8.85000228881836|53.0419921875|10|GISWiki got a GoogleMap</GoogleMap>
| + | |
− | | + | |
− | ==Marker Extension==
| + | |
− | | + | |
− | ===Code===
| + | |
− | | + | |
− | <pre>
| + | |
− | | + | |
− | <?php
| + | |
− | | + | |
− | # Google Map WikiMedia extension
| + | |
− | #
| + | |
− | # Copy this text into a file called "hjlGoogleMapMarker.php"
| + | |
− | # To activate the extension, include it from your LocalSettings.php
| + | |
− | # with: include("extensions/hjlGoogleMap.php");
| + | |
− | #
| + | |
− | # Use the tags <GoogleMapM>Latitude|Longitude|ZoomFactor|URL|URL-Text|URL-Image|Image-Height<GoogleMapM> to display this map.
| + | |
− | #
| + | |
− | # Sample: "<GoogleMapM>7.803|53.053|10|http://www.giswiki.org/|GISWiki|http://www.giswiki.org/skins/common/images/wiki.png\|30</GoogleMapM>"
| + | |
− | #
| + | |
− | # Missing: error-handling, ....
| + | |
− | | + | |
− | | + | |
− | $wgExtensionFunctions[] = "wfGoogleMapMarkerExtension";
| + | |
− | | + | |
− | function wfGoogleMapMarkerExtension()
| + | |
− | {
| + | |
− | global $wgParser;
| + | |
− | $wgParser->setHook( "GoogleMapM", "renderGoogleMapMarker" );
| + | |
− | }
| + | |
− | | + | |
− | # The callback function for converting the input text to HTML output
| + | |
− | function renderGoogleMapMarker( $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'>(ö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=ABQIAAAAtThFd25f3RSm_Uyo-qMHZhSEt_GnVgvWmIxz4pFM1BN9jZGypxTTPP-dRrFjQMULBxRQCp9iRU2O2w' 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(".$varLat.", ".$varLon."), ".$varZoom.");
| + | |
− | map.setMapType(_SATELLITE_TYPE);
| + | |
− | var point = new GPoint(".$varLat.",".$varLon.");
| + | |
− | var marker = createMarker(point, '".$varInfo."');
| + | |
− | map.addOverlay(marker);
| + | |
− | </script>
| + | |
− | ";
| + | |
− | | + | |
− | return $aMap;
| + | |
− | }
| + | |
− | ?>
| + | |
− | | + | |
− | | + | |
− | | + | |
− | </pre>
| + | |
− | | + | |
− | ===Beispiel===
| + | |
− | | + | |
− | '''Eingabe'''
| + | |
− | | + | |
− | <nowiki>
| + | |
− | <GoogleMapM>7.803|53.053|10|http://www.giswiki.org/|GISWiki|http://www.giswiki.org/skins/common/images/wiki.png\|30</GoogleMapM>
| + | |
− | </nowiki>
| + | |
− | | + | |
− | '''Ergebnis'''
| + | |
− | | + | |
− | <GoogleMapM>7.803|53.053|10|http://www.giswiki.org/|GISWiki|http://www.giswiki.org/skins/common/images/wiki.png\|30</GoogleMapM>
| + | |
− | | + | |
− | = Weblink =
| + | |
− | * http://maps.google.com/
| + | |
− | * [http://www.google.com/apis/maps/ Programmierschnittstelle (API) für die Google Maps]
| + | |
− | | + | |
− | =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]
| + | |
| | | |
| + | * [[Point-Mapping Extension]] |
| | | |
| [[Kategorie:Web Mapping]] | | [[Kategorie:Web Mapping]] |
| [[Kategorie:Geodaten]] | | [[Kategorie:Geodaten]] |
| + | [[Kategorie:MediaWiki]] |