• [MOD] Google-Maps Integration V.01 5 0 5 1
Currently:  

Author Topic: [MOD] Google-Maps Integration V.01  (Read 270838 times)

0 Members and 1 Guest are viewing this topic.

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #195 on: December 03, 2013, 02:18:25 PM »
I replace a key, put a piece of code (step 9) and googlemap.js. as not working and not working

could you solve your problem?

My problem in koordinatencheck.html  of MOD (Google-Maps / GPS Integration V1.2).
As far as I understand, Google has changed the syntax and transfer coordinate marker transfer via jquery is not happening.

Yes, you are right - I could dublicate the problem! perhaps Andi can help (us)?!

Rembrandt

  • Guest
Re: [MOD] Google-Maps Integration V.01
« Reply #196 on: December 03, 2013, 08:23:09 PM »
ja, ich murks eh schon herum....

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #197 on: December 03, 2013, 08:27:28 PM »
ja, ich murks eh schon herum....

naja als "murksen" kann man deine tolle arbeit hier sicherlich nicht bezeichnen  :wink:
« Last Edit: December 05, 2013, 03:33:19 PM by bergblume »

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #198 on: December 05, 2013, 03:33:08 PM »
evtl. könnte das hier helfen... das "problem" scheint ja zu sein, daß ein undefined statt der koordinaten in der admin/koordinatencheck.html erscheint:

http://www.svensoltmann.de/google-maps-koordinaten.html

Rembrandt

  • Guest
Re: [MOD] Google-Maps Integration V.01
« Reply #199 on: December 05, 2013, 05:44:55 PM »
Hi!

1.) Download the file from the Attachment "googlemap_v3.js" and store it in your Galery "root/js"

2.) search in details.php Step 4.) and replace it with this:

//############################ Start Google Map ################################# 
$google_map="";
if(
$image_row['image_gmap_show'] && $image_row['image_gmap_latitude'] && $image_row['image_gmap_longitude']){

  
$photomap =1// turn photomap off "0"

  
if ($image_row['image_gmap_type'] == 1) {
    
$image_gmap_type "TERRAIN";
  } elseif (
$image_row['image_gmap_type'] == 2) {
    
$image_gmap_type "SATELLITE";
  } elseif (
$image_row['image_gmap_type'] == 3) {
    
$image_gmap_type "HYBRID";
  }
      
  if(
$photomap){
    
$sql "SELECT i.image_id, i.cat_id, i.image_name, i.image_media_file, i.image_thumb_file, i.image_date".$additional_sql."
            FROM "
.IMAGES_TABLE." i
            WHERE image_active = 1 AND cat_id = 
$cat_id
           "
;
    
$result $site_db->query($sql);
    
    
$si=1;  
    while(
$row2 $site_db->fetch_array($result)) {
      
$image_thumb_file get_thumbnail_code($row2['image_media_file'], $row2['image_thumb_file'], $row2['image_id'], $row2['cat_id'], $row2['image_name'], $mode1);
      
      
$contentString "
        '<div style=\"text-align:left; margin:0;padding:0\">'+
          '<p style=\"text-align:left\">"
.$lang['image_gmap_text1']."<b>\"".$row2['image_name']."\"</b></p>'+
          '"
.$image_thumb_file."'+
          '<p style=\"text-align:left\">"
.$lang['image_gmap_text2']." :<br>'+
          '<b>Lat: </b>"
.$row2['image_gmap_latitude']."°<br>'+
          '<b>Lon: </b>"
.$row2['image_gmap_longitude']."°'+
          '</p>'+
        '</div>'"
;
      
      
$locations.= "[".$contentString.",".$row2['image_gmap_latitude'].",".$row2['image_gmap_longitude'].",".$si."],"
      
$si++; 
    } 
  }
  else{
    
$locations "''";
    
$contentString "''";
  }

  
$image_gmap_thumb_file get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode1);
  
$currentContentString "
  '<div style=\"text-align:left; margin:0;padding:0\">'+
    '<p style=\"text-align:left\">"
.$lang['image_gmap_text1']." <b>\"".$image_name."\"</b></p>'+
    '"
.$image_gmap_thumb_file."'+
    '<p style=\"text-align:left\">"
.$lang['image_gmap_text2']." :<br>'+
    '<b>Lat: </b>"
.$image_row['image_gmap_latitude']."°<br>'+
    '<b>Lon: </b>"
.$image_row['image_gmap_longitude']."°'+
    '</p>'+
  '</div>'"
;
    
  
$google_map "
    <script type='text/javascript' src='./js/googlemap_v3.js'></script>
      <script type='text/javascript'>
         photomap = '
$photomap';
         Zoomi = '"
.$image_row['image_gmap_zoom']."';
         MapStyle = '
$image_gmap_type';
         GPSLatitude = '"
.$image_row['image_gmap_latitude']."';
         GPSLongitude = '."
$image_row['image_gmap_longitude']."';
         imagename = '
$image_name';
         contentString = 
$contentString;
         currentContentString = 
$currentContentString;
         thumbnailMarkerUrl = '';
         locations = [
$locations];
      </script>"
;
}   
  
$site_template->register_vars(array(
    
"google_map" => $google_map    
  
));
   
//############################ End Google Map #################################  


3.) search in your templates/details.html "Step.5)" and remove it completly.
 the new "Step 5.)" insert where ever you want:
Code: [Select]
{if google_map}
  <div id="map_canvas" style="width:600px; height:400px; margin:10px 0px;"></div>
 {google_map}
{endif google_map

DEMO zoom in and you can see the  Weather layer and the other Pictures (click on Marker).

mfg Andi
« Last Edit: December 05, 2013, 06:59:51 PM by Rembrandt »

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #200 on: December 06, 2013, 11:04:13 AM »
sehr genial! Danke dir!
wie müsste denn dann auch noch die admin/koordinatencheck.html abgeändert werden?

aktuell schaut die bei mir und auch bei bma2004 so aus:

Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Dieses Script ist von Erik Groennerud und wurde für die Gallery 4Images programmiert.
12.2007 - www.koelschwasser.de
Version 2.0-->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps Koordinatensuche</title>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=GOOGLEKEY" type="text/javascript"></script>
<script type="text/javascript" src="/admin/scripts/jsr_class.js"></script>
<script type="text/javascript">

function objProperties(myObject){
var out = new Array();
for( property in myObject ) {
out.push(property + " = " + myObject[property]);
}
return out;
}
</script>


<script type="text/javascript">

//<![CDATA[





function load() {
xok=0;
yok=0;
zok=0;

if (GBrowserIsCompatible()) {

zoom=parseInt(opener.document.form.elements['image_gmap_zoom'].value);
if ((zoom < 21) && (zoom > 0))
{
zok = 1;
} else {
zoom = 3;
}
pointy = parseFloat(opener.document.form.elements['image_gmap_latitude'].value);
if ((pointy > -90) && (pointy < 90))
{
yok = 1;
} else {
pointy = 50;
}
pointx = parseFloat(opener.document.form.elements['image_gmap_longitude'].value);
if ((pointx > -180) && (pointx < 180))
{
xok = 1;
} else {
pointx = 9;
}


   map = new GMap2(document.getElementById("map"));
  map.addControl(new GOverviewMapControl());
map.addControl(new GLargeMapControl());
      map.addControl(new GMapTypeControl());
      map.addControl(new GScaleControl());
      map.enableScrollWheelZoom();  
map.addMapType(G_PHYSICAL_MAP);  


  var copycycle1 = "&copy; Cloudmade: ";
  var copycycle2 = "<a href='http://www.cloudmade.com' target='_blank'>";
  var cycle = [new GTileLayer()];
  cycle[0].getTileUrl = function(a,b) {
  return "http://tile.opencyclemap.org/cycle/" + b + "/" + a.x + "/" + a.y + ".png"; };
  cycle[0].getCopyright = function(a,b) {
  return {prefix:copycycle1, copyrightTexts:[copycycle2]}; }
  G_CYCLE_MAP = new GMapType(cycle, G_SATELLITE_MAP.getProjection(), "Cycle-Map", {
  shortName: "Cycle-Map", alt: "Cycle-Map von Cloudmade.com anzeigen",
  minResolution:0,maxResolution:17});
  map.addMapType(G_CYCLE_MAP);

      map.setCenter(new GLatLng(pointy, pointx), zoom, G_PHYSICAL_MAP);
      geocoder = new GClientGeocoder();
      
      
      if ((xok==1) && (yok ==1) && (zok ==1)) {
      
       marker = new GMarker(map.getCenter());
map.addOverlay(marker);

marker.openInfoWindowHtml("<b>Latitude:</b> " + pointy + "<br />" + "Longitude: " + pointx+ "<br />" + "Zoomlevel: " + map.getZoom());
document.getElementById('latitude').value = pointy;
document.getElementById('longitude').value = pointx;
document.getElementById('zoom').value = zoom;

request = 'http://ws.geonames.org/findNearbyPostalCodesJSON?lat=' + pointy + '&lng=' + pointx + '&callback=getLocation';

   // Create a new script object
     aObj = new JSONscriptRequest(request);
   // Build the script tag
  aObj.buildScriptTag();
   // Execute (add) the script tag
   aObj.addScriptTag();
      
      }

   
      
      GEvent.addListener(map, 'click', function(event) {


if (point){
document.getElementById('latitude').value = event.latLng.lat();
document.getElementById('longitude').value = event.latLng.lon();
document.getElementById('zoom').value = map.getZoom();



}


if (marker) {
map.removeOverlay(marker);


} else {
map.clearOverlays();
marker = new GMarker(point);
map.addOverlay(marker);

marker.openInfoWindowHtml("<b>Latitude:</b> " + point.y + "<br />" + "Longitude: " + point.x+ "<br />" + "Zoomlevel: " + map.getZoom());
}

if (point){

   request = 'http://ws.geonames.org/findNearbyPostalCodesJSON?lat=' + point.y + '&lng=' + point.x + '&callback=getLocation';

   // Create a new script object
     aObj = new JSONscriptRequest(request);
   // Build the script tag
  aObj.buildScriptTag();
   // Execute (add) the script tag
   aObj.addScriptTag();

}


}
);
}
}

function addAddressToMap(response) {
      map.clearOverlays();
      if (!response || response.Status.code != 200) {
        alert("Sorry, konnte leider Adresse nicht finden!");
      } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
      
   marker.openInfoWindowHtml("<b>Latitude:</b> " + point.y + "<br />" + "Longitude: " + point.x+ "<br />" + "Zoomlevel: " + map.getZoom());
   document.getElementById('latitude').value = event.latLng.lat();
document.getElementById('longitude').value = event.latLng.lon();
document.getElementById('zoom').value = map.getZoom();


}}

    function showLocation() {
      var address = document.forms[0].q.value;
      geocoder.getLocations(address, addAddressToMap);
    }
    
    function getLocation(jData) {
    

  if (jData == null) {
    // There was a problem parsing search results
    return;
  }
  
  var html = '';
  var postalCodes = jData.postalCodes;
     var name = postalCodes[0];
     // we create a simple html list with the geonames objects
     // the link will call the center() javascript method with lat/lng as parameter
     html = html + '<a href="javascript:center(' + name.lat +',' + name.lng + ');">' + name.placeName + '</a><br>';

 
    var point = new GLatLng(parseFloat(name.lat), parseFloat(name.lng));
var address = name.placeName + ", "+ name.countryCode;
// Adresse in Suchfeld eintragen
    document.forms[0].q.value = address;
    



map.addOverlay(marker);

marker.openInfoWindowHtml("<b>Latitude:</b> " + pointy + "<br />" + "Longitude: " + pointx+ "<br />" + "Zoomlevel: " + map.getZoom());
var marker = new GMarker(point);                  
           map.addOverlay(marker);
marker.openInfoWindowTabsHtml(infoTabs);



}

function OK() {

opener.document.form.elements['image_keywords'].value = opener.document.form.elements['image_keywords'].value + " " + document.forms[0].q.value;

opener.document.form.elements['image_gmap_latitude'].value= document.forms[0].latitude.value;
opener.document.form.elements['image_gmap_longitude'].value=document.forms[0].longitude.value;
opener.document.form.elements['image_gmap_zoom'].value = document.forms[0].zoom.value;

opener.document.form.elements['image_gmap_type'].value = "3";
opener.document.form.elements['image_gmap_show'][0].checked = true;

self.close();

}


//]]>
</script>
</head>


<body onload="load()" onunload="GUnload()">

<center>
<form action="#" onsubmit="showLocation(); return false;">
      <b>Adresse eingeben oder klicke in Karte:</b><br>
        <input type="text" name="q" value="" class="address_input" size="40" />
        <input type="submit" name="find" value="Search" />




<div id="map" style="width: 500px; height: 500px"></div>


<div>
Breitengrad: <input name="latitude" id="latitude" type="text" />
Zoom: <input name="zoom" id="zoom" type="text" size="2"/>
Laengengrad: <input name="longitude" id="longitude" type="text" />

</div>
   </form>
<script type="text/javascript" language="JavaScript">
<!--
if (window.opener)

document.write('<input type="button" name="OK" value="OK" onclick="OK();">');
document.write('<input type="Button" name="Abbrechen" value="Abbrechen" onclick="self.close();">');

//-->
</script>

</center>
</body>
</html>

Rembrandt

  • Guest
Re: [MOD] Google-Maps Integration V.01
« Reply #201 on: December 06, 2013, 12:05:26 PM »
Was macht die Koordinatencheck?

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #202 on: December 06, 2013, 12:11:06 PM »
Was macht die Koordinatencheck?

die wird aus dem admin bereich aufgerufen und man kann dort die GPS Koordinaten entsprechend durch klick auf die karte anpassen
http://www.4homepages.de/forum/index.php?topic=19926.0

Offline zex2

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #203 on: February 10, 2015, 01:59:07 AM »
Hallo zusammen,

heute habe ich ein Fehler gesucht. Die Map ist verschwunden. Meine Web-Seite ist http://bahnzuege.de/index.php?template=google-photo-map. Konnen sie mir Helfen?  :)

Rembrandt

  • Guest
Re: [MOD] Google-Maps Integration V.01
« Reply #204 on: February 10, 2015, 05:32:25 AM »
... Die Map ist verschwunden....
Deine Map Funktioniert

mfg Andi

Offline zex2

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #205 on: February 10, 2015, 04:51:04 PM »
... Die Map ist verschwunden....
Deine Map Funktioniert

mfg Andi

Ja, ich habe gemacht... ich habe vergessen Google Key einzufugen.

 

Post your comments here