Seite 2 von 2

Re: Makierungen auf einer Weltkarte

Verfasst: 05.02.2010 18:07
von VIP3R
Juhu!
ich habs gelöst :)

ACP -> Posting ->BBcodes

BBCode usage:

Code: Alles auswählen

[Map={TEXT}]{TEXT2}[/Map]
HTML replacement:

Code: Alles auswählen

<script src="http://maps.google.com/maps?file=api&v=2.x&key=HIER API CODE EINTRAGEN!!!" type="text/javascript"></script>
    <script type="text/javascript">

    var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(0.0000000, 0.0000000), 13  );
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GScaleControl());
        map.addControl(new GOverviewMapControl());
        geocoder = new GClientGeocoder();
        showAddress("{TEXT}");
      }
    }

    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " doesn't exists");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml("<br \/><strong>{TEXT}: {TEXT2}<\/strong>");

            }
          }
        );
      }
    }
    </script>

  <body onload="initialize()" onunload="GUnload()">
    <form action="#" onsubmit="showAddress(this.address.value); return false">
      <p> 	  
		  
       <input type="text" size="60" name="address" value="{TEXT}" /> 
        <input type="submit" value="Go!" /> 
      </p>
     <div id="map_canvas" style="width: 550px; height: 500px"></div> 
     </form>
Help line:

Code: Alles auswählen

[Map=Location]description[/Map]
[ externes Bild ]




EDIT

na toll!
beim IE Funktioniert es natürlich nicht! :(

Re: Makierungen auf einer Weltkarte

Verfasst: 05.02.2010 19:29
von 4seven
meine version geht in allen browser und ist noch dazu xhtml 1.0 strict

außerdem hat das replacement einen body-tag, was html-technisch fürs phpbb3 eine vollkatastrophe ist

Code: Alles auswählen

  <body onload="initialize()" onunload="GUnload()">
so hast du nämlich gleich mindestens zwei body-tags im quellcode, was nicht nur onkel w3c missfällt :wink:

Re: Makierungen auf einer Weltkarte

Verfasst: 05.02.2010 19:38
von VIP3R
ich hab mir schon gedacht das er Code ziemlich daneben ist. :D
aber ich bin auch noch ein Anfänger was PHP angeht und bin für jeden Verbesserungsvorschlag dankbar :)

Re: Makierungen auf einer Weltkarte

Verfasst: 05.02.2010 21:52
von 4seven
nee nee, is schon genial, das du es so hinbekommen hast. daneben isses nicht :wink:

Re: Makierungen auf einer Weltkarte

Verfasst: 17.02.2010 21:15
von VIP3R
so ich denke das ist jetzt die final Version :)

ich rufe jetzt eine Seite auf wo ich die Map drin habe.

BBCode usage:

Code: Alles auswählen

[Map={SIMPLETEXT}]{SIMPLETEXT1}[/Map]
HTML replacement:

Code: Alles auswählen

<iframe width="700" height="700" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="geocoding.php?para1={SIMPLETEXT}&para2={SIMPLETEXT1}"></iframe>
Help line:

Code: Alles auswählen

[Map=Location]Beschreibung[/Map]
im Root verzeichniss folgende Datei anlegen
geocoding.php

Code: Alles auswählen

<?php

/**
*
* @package Geocoding
* @version 1.0
* @copyright (c) 2010 Pagani-Zonda.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

// para1 = Ort 
$adresse = $_GET["para1"];
// para2 = Beschreibung
$beschreibung = $_GET["para2"];
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>Geocoding</title>
     
    <script src="http://maps.google.com/maps?file=api&v=2.x&key=HIER-API-CODE" type="text/javascript"></script>
    <script type="text/javascript">
	
	var map = null;
    var geocoder = null;


    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(0.0000000, 0.0000000), 13  );
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GScaleControl());
        map.addControl(new GOverviewMapControl());
        geocoder = new GClientGeocoder();
 	    showAddress("<?php echo $adresse; ?>");
	   
	   
      }
    }

    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " doesn't exists");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml("<?php echo $beschreibung; ?>");       
      		  

            }
          }
        );
      }
    }
	
    </script>
  </head>

  <body onload="initialize()" onunload="GUnload()" style="font-family:Verdana;font-size:0.8em;">
    <form action="#" onsubmit="showAddress(this.address.value); return false">
     <div id="map_canvas" style="width: 550px; height: 500px"></div> 
     </form> 
		
  </body>
</html>

Re: Makierungen auf einer Weltkarte

Verfasst: 18.02.2010 06:20
von franki
Rambaldi hat geschrieben:ich danke dir recht herzlich, suche aber etwas wie die Geomap!
Dann durfte die Phoogle-Map das sein was Du suchst
viewtopic.php?f=88&t=194443&hilit=phoogle+map#p1122135
oder den Nachfolger (Beta) shmoogle-Map - da mußt du aber mal bei http://phpbb.com suchen.