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

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

0 Members and 1 Guest are viewing this topic.

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #165 on: November 19, 2009, 02:35:45 PM »
... mit der neuen "Tab-Formatierung" hier im Forum sieht der "Step 1" auch etwas "neu" aus, daher zunächst die banale Frage ...
... die entsprechenden Felder in der DB-Tabelle "4images_images" sind angelegt ... ?
... darüberhinaus hilft natürlich immer ein Link, um sich das Problem auch ansehen zu können ... !
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #166 on: January 11, 2010, 02:04:40 PM »
hallo zusammen,

eine kurze frage zu diesem genialen mod...

wie kann ich es erreichen, dass in meiner googlemap auch andere marker (aus anderen Kategorien) erscheinen?
aktuell wird ja ein roter marker für den standort des fotos angezeigt. ich möchte aber neben diesem standort auch andere standorte (aus anderen kategorien in der gmap angezeigt bekommen).

ich habe es z.b. schon geschafft, webcams in der details.php mittels dem code
map.addOverlay(new GLayer(\"com.google.webcams\"));
einzzubinden..
gibt es nun eine einfache overlay function so dass ich z.B. alle fotos  mit koordinaten aus der Kategorie 1 in dieser Googlemap ebenso angezeigt bekomme?

Vielen dank für eure hilfe!
bergblume


Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #168 on: January 13, 2010, 02:55:58 PM »
ja, diese beiden habe ich ja auch installliert...

aber ich muss doch nun irgendwie meine details.php (und dort speziell diesen abschnitt), so abändern, dass in der googlemap auf meiner detail-seite neben der position des bildes auch die anderen positionen der bilder (wahlweise kategorien aktiviert oder deaktiviert) angezeigt werden.... ich komm aber niocht drauf was ich ändern muss  :(

Code: [Select]
// >>>>>>>>>>>>>>>>>> [MOD] Google-Map >>>>>>>>>>>>>>>>>>
// Read GPS Exif Infos
$src = MEDIA_PATH."/".$cat_id."/". $image_row['image_media_file'] ;

if (function_exists('exif_read_data') && $exif_data = @exif_read_data($src, 'EXIF')) {
          $exif_array = get_exif_info($exif_data);
          foreach ($exif_array as $key => $val) {
          if (($key != "GPSLongitudeRef") &&  ($key != "GPSLatitudeRef")) {
          if ($key == "GPSLongitude") {
          $GPSLongtude = substr (strrchr($val, "("), 1);
          $GPSLongtude = substr ($GPSLongtude,0, strlen($GPSLongtude)-1);
          }
          if ($key == "GPSLatitude") {
          $GPSLatitude = substr (strrchr($val, "("), 1);
          $GPSLatitude = substr ($GPSLatitude,0, strlen($GPSLatitude)-1);
          }

              }
          }

        }
 // End of GPS EXIF Functions


$image_gmap_show = $image_row['image_gmap_show'];

if (($image_gmap_show == 1) || (($GPSLongtude <> "") && ($GPSLatitude <>""))) {

  $image_gmap_longitude = $image_row['image_gmap_longitude'];
  if ($image_gmap_longitude == "" ) $image_gmap_longitude = $GPSLongtude;
  $image_gmap_latitude = $image_row['image_gmap_latitude'];
  if ($image_gmap_latitude == "" ) $image_gmap_latitude = $GPSLatitude;
  $image_gmap_zoom = $image_row['image_gmap_zoom'];
  if ($image_gmap_zoom == "") $image_gmap_zoom = 17;   // Falls keine Zoom level gesetzt, setze Ihn.
 
  $image_gmap_type = $image_row['image_gmap_type'];
  $image_gmap_catid = $image_row['cat_id'];
  $image_gmap_catname = $image_row['cat_name'];
  $image_gmap_imgdate = $image_row['image_date'];
  $image_gmap_thumb = $image_row['image_thumb_file'];
  $image_gmap_thumb_file = get_file_path($image_gmap_thumb, "thumb", $image_gmap_catid, 0, 1);

if ($image_gmap_show == 0) {

  $image_gmap_tab1 = "<table border='0' cellspacing='0' cellpadding='0'><tr><td><img src='"
                     .$image_gmap_thumb_file. "' border='1' width='100' height='75' alt='"
                     .$image_name. "' /></td><td>&nbsp;&nbsp;</td></td><td valign='top'><font color='#000000'>"
                     ."<small><center><b>EXIF GPS Daten:</b><br></center>".$lang['image_gmap_text1']."<br><b>" .$image_name. "</b><br>".$lang['image_gmap_text2']
                     ."</small><span style='font-size:8px;'><br><br><b>Breitengrad:</b> "
                     .$image_gmap_latitude. "°<br><b>Längengrad:</b> ".$image_gmap_longitude."°</span></font>"
                     ."</td></tr></table>";
} else {

  $image_gmap_tab1 = "<table border='0' cellspacing='0' cellpadding='0'><tr><td><img src='"
                     .$image_gmap_thumb_file. "' border='1' width='100' height='75' alt='"
                     .$image_name. "' /></td><td>&nbsp;&nbsp;</td></td><td valign='top'><font color='#000000'>"
                     ."<small><center><b>DB GPS Daten</b><br></center>".$lang['image_gmap_text1']."<br><b>" .$image_name. "</b><br>".$lang['image_gmap_text2']
                     ."</small><span style='font-size:8px;'><br><br><b>Breitengrad:</b> "
                     .$image_gmap_latitude. "°<br><b>Längengrad:</b> ".$image_gmap_longitude."°</span></font>"
                     ."</td></tr></table>";
}
  if ($image_gmap_type == 1) {
    $image_gmap_type2 = "G_NORMAL_MAP";
  } elseif ($image_gmap_type == 3) {
    $image_gmap_type2 = "G_HYBRID_MAP";
  } else {
  $image_gmap_type2 = "G_SATELLITE_MAP";
  }

  if ($config['language_dir'] == "deutsch") {
    $gmap_language = "de";
  } else{
    $gmap_language = "en";
  }

  $gmap = 1;

  $gmap_java = "<script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAmIJXqPWtDlh0oKLa6JIGBhQ1p1cFWAjqVkcO6dxUzH-PtfTpxxTxUkEDjfvbEiRC9DVoXH9pIXbCgQ";
   $gmap_java = $gmap_java . $gkey . "'" ."
      type='text/javascript'></script>
    <script type='text/javascript'>
    //<![CDATA[



var tinyIcon = new GIcon();

tinyIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";

tinyIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";

tinyIcon.iconSize = new GSize(12, 20);

// tinyIcon.shadowSize = new GSize(22, 20);

tinyIcon.iconAnchor = new GPoint(1, 14);

tinyIcon.infoWindowAnchor = new GPoint(1, 14);


// Set up our GMarkerOptions object literal

markerOptions = { icon:tinyIcon };



if (GBrowserIsCompatible()) {
       
     function load() {
var map = new GMap2(document.getElementById('map'));
      map.addMapType(G_PHYSICAL_MAP);
map.addControl(new GOverviewMapControl());
map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.addControl(new GScaleControl());

map.addOverlay(new GLayer(\"com.google.webcams\"));




       


              map.disableScrollWheelZoom();   
    map.setCenter(new GLatLng(0, 0), 0, G_HYBRID_MAP);
    map.enableDoubleClickZoom();
        map.enableContinuousZoom();
    var bounds = new GLatLngBounds();
    //--- Relieffunktion von http://www.maps-for-free.com/ ---
            var copyright1 = \"&copy; Relief Maps: \";
            var copyright2 = \"<a href='http://creativecommons.org/licenses/by-sa/3.0/' target='_blank'>\";
            var copyright3 = \"License\";
            var copyright4 = \"</a> \";
            var relief_water = [new GTileLayer()];
            relief_water[0].getTileUrl = function(a,b) {
              return \"http://srtm.in-ulm.de/layer/relief_water_jpg/z\" +
              b + \"/row\" + a.y + \"/\" + b + \"_\" + a.x + \"-\" + a.y + \".jpg\"; };
            relief_water[0].getCopyright = function(a,b) {
              return {prefix:copyright1, copyrightTexts:[copyright2 + copyright3 + copyright4]}; }
            relief_water[1] = G_HYBRID_MAP.getTileLayers()[1];
            G_RELIEF_WATER_MAP = new GMapType(relief_water, G_SATELLITE_MAP.getProjection(), \"Relief [+]\", {
              minResolution:0,maxResolution:10});
            map.addMapType(G_RELIEF_WATER_MAP);

            var relief = [new GTileLayer()];
            relief[0].getTileUrl = function(a,b) {
              return \"http://srtm.in-ulm.de/layer/relief/z\" +
              b + \"/row\" + a.y + \"/\" + b + \"_\" + a.x + \"-\" + a.y + \".jpg\"; };
            relief[0].getCopyright = function(a,b) {
              return {prefix:copyright1, copyrightTexts:[copyright2 + copyright3 + copyright4]}; }
            G_RELIEF_MAP = new GMapType(relief, G_SATELLITE_MAP.getProjection(), \"Relief [-]\", {
              minResolution:0,maxResolution:11});
            map.addMapType(G_RELIEF_MAP);
     map.setCenter(new GLatLng(" .$image_gmap_latitude. "," .$image_gmap_longitude. "), " .$image_gmap_zoom. ", " .$image_gmap_type2. ");
var infoTabs = [
  new GInfoWindowTab(\"Bild\", \"" .$image_gmap_tab1. "\"),
  new GInfoWindowTab(\"Routenplaner\", \"<b>Route hierher berechnen mit Google-Maps :</b><br>Ziel-Adresse : ".$image_name."<br>Start-Adresse hier eintragen :<form action='http://maps.google.com/maps' method='get' target='_blank'><input type='text' size='30' maxlength='50' name='saddr' id='saddr' value=' ' />&nbsp;<input value='Los !' type='submit'><input type='hidden' name='daddr' value=' " .$image_gmap_latitude. " , " .$image_gmap_longitude. " '></form><br>Der Plan wird in einem neuen Fenster angezeigt.\")
];
     var marker = new GMarker(map.getCenter());
     GEvent.addListener(marker, \"click\", function() {
     marker.openInfoWindowTabsHtml(infoTabs);
     });
     map.addOverlay(marker);
     marker.openInfoWindowTabsHtml(infoTabs);
     }
     }
     //]]>
     </script>";


$maplinks="<a href = 'http://maps.google.de/maps?q=$image_gmap_latitude,$image_gmap_longitude&t=h&ie=UTF8&ll=$image_gmap_latitude,$image_gmap_longitude&spn=0.002316,0.005021&z=18&om=1' target='_blank'>Position in neuer Google Karte öffnen</a>&nbsp;&nbsp;&nbsp;<a href = 'http://maps.live.com/default.aspx?v=2&cp=$image_gmap_latitude~$image_gmap_longitude&style=h&lvl=17&tilt=-90&dir=0&alt=-1000&scene=6176719&encType=1' target='_blank'>Position in neuer Microsoft Live Karte öffnen</a>&nbsp;&nbsp;&nbsp;<a href = 'http://www.flashearth.com/?lat=$image_gmap_latitude&lon=$image_gmap_longitude&z=15.8&r=0&src=ggl' target='_blank'>Position in Flash Earth öffnen</a>";

  $site_template->register_vars(array(
    "gmap"   => $gmap,
    "gmap_java" => $gmap_java,
    "maplinks" => $maplinks,
  ));


} else {
  $gmap = 0;
  $site_template->register_vars(array(
      "gmap"   => $gmap,
      "gmap_java" => "",
  ));
}

unset($gmap_java);

// <<<<<<<<<<<<<<<<<< [MOD] Google-Map <<<<<<<<<<<<<<<<<<

geht das nicht irgendwie so, dass ich einen addoverlay einfüge... so wie auch über

Code: [Select]
map.addOverlay(new GLayer(\"com.google.webcams\"));
die webcams in dieser karte dann eingeblendet werdn?

Rembrandt

  • Guest
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #169 on: January 13, 2010, 03:57:04 PM »
ah.. ok... in dem photmap mod werden alle bilder die mit "$image_gmap_show == 1" in der DB gekennzeichnet sind, in ein xml file geschrieben und dann in der photomap dargestellt.

aber man könnte das alles weglassen,
 in der detail.php die DB abfrage nach "$image_gmap_show == 1" und cat_id filtern..
in dem script eine schleife einbauen die den inhalt der "$image_gmap_tab1" variable dynamisch generiert.
mit dem link zum bild, - beschreibung, - koordinaten, ... e.t.c.
 
dann gibt es eben eine:
"$image_gmap_tab1"
"$image_gmap_tab2"
"$image_gmap_tab3"
e.t.c.

mfg Andi

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #170 on: January 13, 2010, 04:03:37 PM »
ja, genau so möchte ich es machen...

welche befehlte müsste ich dann wo in meine details.php einbauen??? sorry, dass ihc so "doof" frage,.. habe da jetzt schon ein paar wochen rumgemacht und es nicht hinbekommen....

danke für deinen input!

Rembrandt

  • Guest
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #171 on: January 13, 2010, 05:40:57 PM »
ist keineswegs eine "doofe frage", aber die modifikation ist nicht mit zwei codezeilen erledigt.
ich könnte es schon machen, nur im moment bin ich an etwas anderem drann, wird halt ein bischen dauern.

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #172 on: January 13, 2010, 05:43:17 PM »
hi andi,

ahh ok... dann bin ich ja beruhigt, dass es sich um keine triviale modifikation handelt... habe schon an meinen fähigkeiten gezweifelt...
kein problem... ich warte gerne noch ein wenig, wenn du mir (bei Gelegenheit) helfen kannst...

VG, bergblume

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #173 on: February 17, 2010, 07:03:31 PM »
Hi andi,

kannst du mir vll. mit ein bisschen "Code" deinerseits zur Lösung verhelfen  :wink:

vielen dank schon mal!
bergblume

Rembrandt

  • Guest
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #174 on: February 18, 2010, 05:20:17 PM »
gib mir noch zeit bis zum wochenende...

mfg Andi

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #175 on: February 18, 2010, 05:25:31 PM »
gerne!! kein thema... bin überhaupt schon froh, dass du dich dem problem annimmst  :D

Rembrandt

  • Guest
Re: [MOD-beta] Google-Maps Integration V.01
« Reply #176 on: February 19, 2010, 12:07:52 PM »
soda...fertisch :)

Addon "More Marker"

to every image you can add the categorie number, to show marker from another categories.

any changes relate to: http://www.4homepages.de/forum/index.php?topic=16533.msg88318#msg88318

download  "install_gmap_show_cat.php"  from the attachment, copy in your root and call it to.

search in includes/db_field_definitions.php:
$additional_image_fields['image_gmap_show'] = array($lang['image_gmap_show'], "radio"1);
insert below:
$additional_image_fields['image_gmap_show_cat'] = array($lang['image_gmap_show_cat'], "text"0);

search in /lang/<your_language>/main.php:
$lang['image_gmap_show'] = "Show Google Map?";
insert below:
$lang['image_gmap_show_cat'] = "Show Google Map Categories: <span class=\"smalltext\">Categorie numbers must be seperated by ',' </span> ";

replace step 4.) in details.php

// >>>>>>>>>>>>>>>>>> [MOD] Google-Map >>>>>>>>>>>>>>>>>>

$image_gmap_show $image_row['image_gmap_show'];

if (
$image_gmap_show == 1) {

  
$image_gmap_longitude $image_row['image_gmap_longitude'];
  
$image_gmap_latitude $image_row['image_gmap_latitude'];
  
$image_gmap_zoom $image_row['image_gmap_zoom'];
  
$image_gmap_type $image_row['image_gmap_type'];
   
  if (
$image_gmap_type == 1) {
    
$image_gmap_type2 "G_NORMAL_MAP";
  } elseif (
$image_gmap_type == 2) {
    
$image_gmap_type2 "G_SATELLITE_MAP";
  } elseif (
$image_gmap_type == 3) {
    
$image_gmap_type2 "G_HYBRID_MAP";
  }

  if (
$config['language_dir'] == "deutsch") {
    
$gmap_language "de";
  } else{
    
$gmap_language "en";
  }

  
$gmap 1;
 
 
$image_gmap_show_cat = (!empty($image_row['image_gmap_show_cat'])) ? "AND cat_id IN (".$cat_id.",".$image_row['image_gmap_show_cat'].")" "AND cat_id = ".$cat_id."";
  
  
$sql "SELECT  image_id,cat_id, image_name, image_active, image_thumb_file,image_media_file, image_gmap_longitude, image_gmap_latitude, image_gmap_show, image_gmap_show_cat 
          FROM "
.IMAGES_TABLE.
          WHERE image_active = 1 AND image_gmap_show = '1' AND cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").") $image_gmap_show_cat
         "
;
 
$result $site_db->query($sql);
     
$z 1;
    
$point "";
  
  while (
$image_row $site_db->fetch_array($result)){
    
$image_gmap_thumb_file get_file_path($image_row['image_thumb_file'], "thumb"$image_row['cat_id'], 01);
      
$file_src "".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row['image_id'])."";

      
$image_gmap_point "<table border='0' cellspacing='0' cellpadding='0'><tr><td><a href=".$file_src."><img src='"
                          
.$image_gmap_thumb_file."' border='1' width='100' height='75' alt='"
                          
.$image_row['image_name']."'></a></td><td>&nbsp;&nbsp;</td></td><td valign='top'>"
                          
."<small>".$lang['image_gmap_text1']."<br><b>".$image_row['image_name']."</b><br>".$lang['image_gmap_text2']
                          .
"</small><span style='font-size:8px;'><br><br><b>Lat:</b> "
                          
.$image_row['image_gmap_latitude']."&#176;<br><b>Lon:</b>".$image_row['image_gmap_longitude']."&#176;</span>"
                          
."</td></tr></table>";

      
$point .= "var info$z = [new GInfoWindowTab(\"Das Bild\", \"" .$image_gmap_point"\")];\n\n";
      
$point .= "var point$z = new GMarker(new GLatLng(\"".$image_row['image_gmap_latitude']."\",\"".$image_row['image_gmap_longitude']."\"));\n";
      
$point .= "map.addOverlay(point$z);\n";
      
$point .= "GEvent.addListener(point$z, \"click\", function() {point$z.openInfoWindowTabsHtml(info$z);});\n";
    if(
$image_row['image_id'] ==  $image_id){
      
$point .= "point$z.openInfoWindowTabsHtml(info$z);\n\n";
    };
    
$z++;
  } 
//while
  
  
$gmap_java "";
  
$gmap_java "
     <script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;hl="
.$gmap_language."&amp;key=ABQIAAAAaLpTp8_LEv_qTL274046DhTNkUTZtW5G6SR5lAPTRyRgUgm6gBTQaowkA-EWB3nH-6w29F5U0RvGpg\" type=\"text/javascript\"></script> \n
     <script type=\"text/javascript\">
  
      function load() {
        if (GBrowserIsCompatible()) {
          var map = new GMap2(document.getElementById(\"map\")); \n
            map.addControl(new GLargeMapControl()); \n
            map.addControl(new GMapTypeControl()); \n
            map.addControl(new GScaleControl()); \n
            map.addControl(new GOverviewMapControl()); \n
            map.setCenter(new GLatLng(" 
.$image_gmap_latitude"," .$image_gmap_longitude"), " .$image_gmap_zoom", " .$image_gmap_type2"); \n
          "
.$point."
        }
      }
    </script> \n"
;

  
$site_template->register_vars(array(
    
"gmap"   => $gmap,
    
"gmap_java" => $gmap_java,
  ));

} else {
  
$gmap 0;
  
$site_template->register_vars(array(
      
"gmap"   => $gmap,
      
"gmap_java" => "",
  ));
}

unset(
$gmap_java);
// <<<<<<<<<<<<<<<<<< [MOD] Google-Map <<<<<<<<<<<<<<<<<<


have fun!

mfg Andi
« Last Edit: February 20, 2010, 11:30:06 AM by Rembrandt »

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #177 on: February 19, 2010, 01:26:08 PM »
servus Andi!!

cool vielen Dank... kannst du vll. noch eine kurze anleitung zur Benutzung und dazu geben, wie man die verschiedenen (gewünschten) Kategorien darin definieren kann.

Danke, dass du dir die Mühe gemacht hast und ein schönes Wochenende!

Ralf

Rembrandt

  • Guest
Re: [MOD] Google-Maps Integration V.01
« Reply #178 on: February 20, 2010, 11:26:07 AM »
...
kannst du vll. noch eine kurze anleitung zur Benutzung und dazu geben, wie man die verschiedenen (gewünschten) Kategorien darin definieren kann...

kurze anleitung ist gut  :D ich habe meinen vorigen beitrag dahingehen editiert.
ich hoffe es ist verständlich genug :)

mfg Andi

Offline igor3000

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [MOD] Google-Maps Integration V.01
« Reply #179 on: March 02, 2010, 06:24:35 PM »
Good evening!
Prompt to me why at me on an emerging window it is written nothing
and how to translate co-ordinates from 55, 45'34.7"N 37, 37'37.2" E in digital value?

Спасибо :)

 

Post your comments here