Seite 1 von 14

Google Maps Routenplaner

Verfasst: 27.11.2008 23:44
von Leisi
Hi Leute !

Gibt es einen Mod oder bbcode mit dem ich Google Maps Routen im Posting darstellen kann ?
Keine Geo Map oder Ajax Map - für mein Motorradforum gehts mir hauptsächlich um die Routenplanung.
Ok - kleinere Routen kann man ja über den URL Code eingeben - aber ich hätt gern ein kleines Vorschaufenster im Posting das nach anklicken auf Google Maps weiterleitet.

Gruß Leisi

Re: Google Maps Routenplaner

Verfasst: 15.05.2010 14:16
von renekoch
geht mir ebenso aber ich finde hier im forum nicht wirklich was :(

gibt es irgendeinen MOD mit dem man Routenplaner ins Forum integrieren kann ??

Re: Google Maps Routenplaner

Verfasst: 15.05.2010 15:34
von hackepeter13
Bei der Suche nach BBCode, Google und API, findet man unter anderem das Thema "Makierungen auf einer Weltkarte".
Wenn man dort mal die Links von 4seven verfolgt, könnte man evtl. Ansätze finden. ;-)

Re: Google Maps Routenplaner

Verfasst: 17.05.2010 17:32
von renekoch
hackepeter13 hat geschrieben: Wenn man dort mal die Links von 4seven verfolgt, könnte man evtl. Ansätze finden. ;-)
Bei mir funkt. die Links von 4seven nicht

Re: Google Maps Routenplaner

Verfasst: 18.05.2010 16:16
von VIP3R
Hallo,

wenn ich mich noch recht erinnere könnte man die geocoding.php dafür so modifizieren das es auch möglich ist damit eine Route zu erstellen.
viewtopic.php?f=87&t=202186&start=10#p1162321

wenn ich zuhause zeit habe probiere ich es mal aus ;)

Re: Google Maps Routenplaner

Verfasst: 18.05.2010 19:37
von VIP3R
so hier ist mal ein ansatz...

http://forum.pagani-zonda.net/geocoding ... rg,germany
para1 = Start
para2 = Ziel

die angaben bei para1 und para2 müssen Stadt,Land sein.
BBcode

Code: Alles auswählen

[Map1={SIMPLETEXT}]Map2={SIMPLETEXT1}[/Map1]
HTML replacement

Code: Alles auswählen

<iframe width="601" height="570" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="geocoding1.php?para1={SIMPLETEXT}&para2={SIMPLETEXT1}"></iframe>
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 = Start 
$adresse = $_GET["para1"];
// para2 = Ziel
$adresse2 = $_GET["para2"];


$route = "from: " . $adresse;
$route .= " to: " . $adresse2;
echo $route;
?>

<!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=apiKEY!!!" type="text/javascript"></script>
    <script type="text/javascript">
	
	  var map = null;
    var geocoder = null;
    var directionsPanel;
    var directions;
    
    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());
      directionsPanel = document.getElementById("route");
      directions = new GDirections(map, directionsPanel);
      directions.load("<?php echo $route; ?>" );

      }
    }
	
    </script>
  </head>

  <body link="#FF9966" vlink="#FF9900" alink="#FFFFFF"
  onload="initialize()" onunload="GUnload()" style="font-family:Verdana;font-size:0.8em;" >
    <form action="#" onsubmit="showAddress(this.address.value); return false">
      <p> 	  
		  
      </p>
     <div id="map_canvas" style="width: 600px; height: 500px"></div> 
     </form> 
		
  </body>
  <font face="Century Gothic" size="1">   developed by <a href="http://pagani-zonda.net/>Pagani-Zonda.net</a></font>
  
</html>

Re: Google Maps Routenplaner

Verfasst: 18.05.2010 19:44
von renekoch
VIP3R hat geschrieben:so hier ist mal ein ansatz...

Super danke dir für deine Mühen nur hab ich leider keine Ahnung was ich mit den Codes machen soll bin leider absoluter anfänger mit phpbb3 :(

Re: Google Maps Routenplaner

Verfasst: 18.05.2010 22:33
von VIP3R
zuerst musst du im phpbb3 Verzeichnis eine Datei mit dem Namen "geocoding1.php" erstellen.
mit diesen Inhalt:

allerdings muss diese Zeile noch geändert werden:

Code: Alles auswählen

<script src="http://maps.google.com/maps?file=apiKEY!!!" type="text/javascript"></script>
wo Key steht muss du deinen Key eintragen den du hier erstellen kannst:
http://code.google.com/intl/de-DE/apis/maps/signup.html

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 = Start
    $adresse = $_GET["para1"];
    // para2 = Ziel
    $adresse2 = $_GET["para2"];


    $route = "from: " . $adresse;
    $route .= " to: " . $adresse2;
    echo $route;
    ?>

    <!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=apiKEY!!!" type="text/javascript"></script>
        <script type="text/javascript">
       
         var map = null;
        var geocoder = null;
        var directionsPanel;
        var directions;
       
        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());
          directionsPanel = document.getElementById("route");
          directions = new GDirections(map, directionsPanel);
          directions.load("<?php echo $route; ?>" );

          }
        }
       
        </script>
      </head>

      <body link="#FF9966" vlink="#FF9900" alink="#FFFFFF"
      onload="initialize()" onunload="GUnload()" style="font-family:Verdana;font-size:0.8em;" >
        <form action="#" onsubmit="showAddress(this.address.value); return false">
          <p>     
           
          </p>
         <div id="map_canvas" style="width: 600px; height: 500px"></div>
         </form>
          
      </body>
      <font face="Century Gothic" size="1">   developed by <a href="http://pagani-zonda.net/>Pagani-Zonda.net</a></font>
     
    </html>

dann gehst du in Adminbereich unter Posting -> BBCodes und dort auf erstellen.
BBcode:

Code: Alles auswählen

[Map1={SIMPLETEXT}]Map2={SIMPLETEXT1}[/Map1]
HTML replacement:

Code: Alles auswählen

<iframe width="601" height="570" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="geocoding1.php?para1={SIMPLETEXT}&para2={SIMPLETEXT1}"></iframe>

und wie gesagt das ist nur ein Ansatz ich habe das noch nicht wirklich getestet... aber du kannst es ja mal ausprobieren und mir berichten ;)

Re: Google Maps Routenplaner

Verfasst: 19.05.2010 13:49
von renekoch
Habe alles nach deinen angaben erledigt un dwenn ich im Forum nun eine Route anzeigen möchte z.B.

Code: Alles auswählen

[Map1=Wien]Map2=Linz[/Map1]
kommt immer die Fehlermeldung Ihre Anfrage wurde vom Google Maps-API-Server abgelehnt. Der in der Anfrage angegebene "sensor"-Parameter muss entweder "true" oder "false" sein.

???

Re: Google Maps Routenplaner

Verfasst: 19.05.2010 22:01
von VIP3R
kommt immer die Fehlermeldung Ihre Anfrage wurde vom Google Maps-API-Server abgelehnt.
Ohne es zu wissen würde ich mal Tippen das der API Code nicht von Google akzeptiert wird.
Siehst du denn denn überhaupt eine Karte?