Ich habe die das google map modul von mairu gesogen und installt es funzt auch super gut, nur als standard ansicht ist immer die hybrid ansicht zu sehen und ich würd gern auf die normale karte schalten.
hier mal die: include/contents/googlemap.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 | <?php defined ( 'main' ) or die ( 'no direct access' ); require_once ( "googlemap/config.php" ); $title = $allgAr [ 'title' ] . ' :: Googlemap' ; $hmenu = 'Googlemap' ; $design = new design ( $title , $hmenu ); $design ->header(); $tpl = new tpl ( 'googlemap.htm' ); $tpl ->out(0); ob_start(); ?> <script src= "http://maps.google.com/maps?hl=de&file=api&v=2&key=<?php echo GOOGLE_MAP_KEY; ?>" type= "text/javascript" ></script> <script type= "text/javascript" > var iconmember = new GIcon(); iconmember.shadow = "include/contents/googlemap/images/mm_20_shadow.png" ; iconmember.iconSize = new GSize(12, 20); iconmember.shadowSize = new GSize(22, 20); iconmember.iconAnchor = new GPoint(6, 20); iconmember.infoWindowAnchor = new GPoint(5, 1); <?php switch ( strtoupper (GOOGLE_MAP_MEMBERPIN_COLOR)) { case "BLUE" : echo 'iconmember.image = "include/contents/googlemap/images/mm_20_blue.png";' ; break ; case "GREEN" : echo 'iconmember.image = "include/contents/googlemap/images/mm_20_green.png";' ; break ; case "YELLOW" : echo 'iconmember.image = "include/contents/googlemap/images/mm_20_yellow.png";' ; break ; default : echo 'iconmember.image = "include/contents/googlemap/images/mm_20_blue.png";' ; break ; } ?> var iconuser = new GIcon(); iconuser.shadow = "include/contents/googlemap/images/mm_20_shadow.png" ; iconuser.iconSize = new GSize(12, 20); iconuser.shadowSize = new GSize(22, 20); iconuser.iconAnchor = new GPoint(6, 20); iconuser.infoWindowAnchor = new GPoint(5, 1); <?php switch ( strtoupper (GOOGLE_MAP_USERPIN_COLOR)) { case "BLUE" : echo 'iconuser.image = "include/contents/googlemap/images/mm_20_blue.png";' ; break ; case "GREEN" : echo 'iconuser.image = "include/contents/googlemap/images/mm_20_green.png";' ; break ; case "YELLOW" : echo 'iconuser.image = "include/contents/googlemap/images/mm_20_yellow.png";' ; break ; default : echo 'iconuser.image = "include/contents/googlemap/images/mm_20_green.png";' ; break ; } switch ( strtoupper (GOOGLE_MAP_LEADERPIN_COLOR)) { case "TRUE" : echo 'var iconleader = new GIcon();' ; echo 'iconleader.image = "include/contents/googlemap/images/mm_20_red.png";' ; echo 'iconleader.shadow = "include/contents/googlemap/images/mm_20_shadow.png";' ; echo 'iconleader.iconSize = new GSize(12, 20);' ; echo 'iconleader.shadowSize = new GSize(22, 20);' ; echo 'iconleader.iconAnchor = new GPoint(6, 20);' ; echo 'iconleader.infoWindowAnchor = new GPoint(5, 1);' ; break ; default : echo 'var iconleader = iconuser;' ; break ; } ?> var map = new GMap2(document.getElementById( "map" )); map.addControl( new GLargeMapControl()); map.addControl( new GMapTypeControl()); map.enableDoubleClickZoom(); <?php switch ( strtoupper (GOOGLE_MAP_REGION)) { case "EUROPE" : echo 'map.setCenter(new GLatLng(48.8, 8.5), 4);' ; break ; case "NORTH AMERICA" : echo 'map.setCenter(new GLatLng(45.0, -97.0), 3);' ; break ; case "SOUTH AMERICA" : echo 'map.setCenter(new GLatLng(-14.8, -61.2), 3);' ; break ; case "NORTH AFRICA" : echo 'map.setCenter(new GLatLng(25.4, 8.4), 4);' ; break ; case "SOUTH AFRICA" : echo 'map.setCenter(new GLatLng(-29.0, 23.7), 5);' ; break ; case "NORTH EUROPE" : echo 'map.setCenter(new GLatLng(62.6, 15.4), 4);' ; break ; case "EAST EUROPE" : echo 'map.setCenter(new GLatLng(51.9, 31.8), 4);' ; break ; case "GERMANY" : echo 'map.setCenter(new GLatLng(51.1, 10.1), 5);' ; break ; case "FRANCE" : echo 'map.setCenter(new GLatLng(47.2, 2.4), 5);' ; break ; case "SPAIN" : echo 'map.setCenter(new GLatLng(40.3, -4.0), 5);' ; break ; case "UNITED KINGDOM" : echo 'map.setCenter(new GLatLng(54.0, -4.3), 5);' ; break ; case "DENMARK" : echo 'map.setCenter(new GLatLng(56.1, 9.2), 6);' ; break ; case "SWEDEN" : echo 'map.setCenter(new GLatLng(63.2, 16.3), 4);' ; break ; case "NORWAY" : echo 'map.setCenter(new GLatLng(65.6, 13.1), 4);' ; break ; case "FINLAND" : echo 'map.setCenter(new GLatLng(65.1, 26.6), 4);' ; break ; case "NETHERLANDS" : echo 'map.setCenter(new GLatLng(52.3, 5.4), 7);' ; break ; case "BELGIUM" : echo 'map.setCenter(new GLatLng(50.7, 4.5), 7);' ; break ; case "SUISSE" : echo 'map.setCenter(new GLatLng(46.8, 8.2), 7);' ; break ; case "AUSTRIA" : echo 'map.setCenter(new GLatLng(47.7, 14.1), 7);' ; break ; case "POLAND" : echo 'map.setCenter(new GLatLng(52.1, 19.3), 6);' ; break ; case "ITALY" : echo 'map.setCenter(new GLatLng(42.6, 12.7), 5);' ; break ; case "TURKEY" : echo 'map.setCenter(new GLatLng(39.0, 34.9), 6);' ; break ; case "BRAZIL" : echo 'map.setCenter(new GLatLng(-12.0, -53.1), 4);' ; break ; case "ARGENTINA" : echo 'map.setCenter(new GLatLng(-34.3, -65.7), 3);' ; break ; case "RUSSIA" : echo 'map.setCenter(new GLatLng(65.7, 98.8), 3);' ; break ; case "ASIA" : echo 'map.setCenter(new GLatLng(20.4, 95.6), 3);' ; break ; case "CHINA" : echo 'map.setCenter(new GLatLng(36.2, 104.0), 4);' ; break ; case "JAPAN" : echo 'map.setCenter(new GLatLng(36.2, 136.8), 5);' ; break ; case "SOUTH KOREA" : echo 'map.setCenter(new GLatLng(36.6, 127.8), 6);' ; break ; case "AUSTRALIA" : echo 'map.setCenter(new GLatLng(-26.1, 134.8), 4);' ; break ; case "CANADA" : echo 'map.setCenter(new GLatLng(60.0, -97.0), 3);' ; break ; case "WORLD" : echo 'map.setCenter(new GLatLng(25.0, 8.5), 2);' ; break ; default : echo 'map.setCenter(new GLatLng(47.7, 14.1), 7);' ; break ; } switch ( strtoupper (GOOGLE_MAP_TYPE)) { case "SATELLITE" : echo 'map.setMapType(G_SATELLITE_MAP);' ; break ; case "MAP" : echo 'map.setMapType(G_NORMAL_MAP);' ; break ; default : case "HYBRID" : echo 'map.setMapType(G_HYBRID_MAP);' ; break ; } ?> var user = new Array(); var bounds = new GLatLngBounds(); var marker = new Array(); var html_text = new Array(); <?php $where = '' ; if ( $menu ->getA(1) == 'u' ) { $where .= ' AND a.id = ' . $menu ->getE(1) . ' ' ; } elseif ( $menu ->getA(1) == 'g' ) { $where .= ' AND b.gid = ' . $menu ->getE(1) . ' ' ; } $db = db_query("SELECT a.id, a.name, a.staat, a.gmapkoords, a.wohnort, MIN(b.fid) AS fid, a.avatar FROM prefix_user a LEFT JOIN prefix_groupusers b ON a.id = b.uid WHERE a.name <> '' AND a.wohnort <> '' AND a.gmapkoords <> '' $where GROUP BY a.id, a.name, a.staat, a.gmapkoords, a.wohnort"); $i = 0; while ( $rowdata = db_fetch_assoc( $db )) { $search_pattern = array ( "/[^A-Za-z0-9\[\]*.,=()!\"$%&^`´':;ß²³#+~_\-|<>\/@{}äöüÄÖÜ ]/" ); $replace_pattern = array ( "" ); $rowdata [ 'name' ] = preg_replace( $search_pattern , $replace_pattern , $rowdata [ 'name' ]); $search_pattern = "/.gif/" ; $replace_pattern = "" ; $rowdata [ 'staat' ] = preg_replace( $search_pattern , $replace_pattern , $rowdata [ 'staat' ]); $pinicon = 1; if ( $rowdata [ 'fid' ] >= 1 AND $rowdata [ 'fid' ] <= 2) { $pinicon = 3; } elseif ( $rowdata [ 'fid' ] > 2) { $pinicon = 2; } echo "\nuser[" . $i . "] = new Object();\n" ; echo "user[" . $i . "]['id'] = " . $rowdata [ 'id' ] . ";\n" ; echo "user[" . $i . "]['pinicon'] = " . $pinicon . ";\n" ; echo "user[" . $i . "]['name'] = '" . $rowdata ['name '] . "' ;\n"; echo "user[" . $i . "]['city'] = '" . $rowdata ['wohnort '] . "' ;\n"; echo "user[" . $i . "]['country'] = '" . $rowdata ['staat '] . "' ;\n"; echo "user[" . $i . "]['latlng'] = new GLatLng" . $rowdata [ 'gmapkoords' ] . ";\n" ; echo "user[" . $i . "]['avatar'] = '" . ( file_exists ( $rowdata ['avatar ']) ? $rowdata[' avatar '] : ' ') . "' ;\n"; $i ++; } if ( $i == 0) { echo 'map.openInfoWindow(map.getCenter(), document.createTextNode("Keine Einträge für Karte gefunden."));' ; } ?> function createMarker(userindex, maxindex) { var addmarker = 0; var act_latlng = "" +user[userindex][ 'latlng' ]; var avatar = '' ; if (user[userindex][ 'avatar' ] != '' ) { avatar = '<tr><td colspan="2"><img src="' + user[userindex][ 'avatar' ] + '" border="0" style="max-width:64px;" /></td></tr>' ; } html_text[userindex] = '<table border=0 style="text-align:left;"><tr><td colspan="2" align="left" style="border-bottom:1px solid black;"><a href="index.php?user-details-' +user[userindex][ 'id' ]+ '" style="color:blue;font-weight:bold;text-decoration:none;"><small>' +user[userindex][ 'name' ]+ '</small></a></td></tr>' + '<tr><td><small><span style="color: black;">Location</span></small></td><td><small><span style="color: black;">' +user[userindex][ 'city' ]+ ', ' +user[userindex][ 'country' ]+ '</span><small></td></tr>' + avatar + '</table>' ; if (user[userindex][ 'pinicon' ] == 2) { marker[userindex] = new GMarker(user[userindex][ 'latlng' ], iconmember); } else if (user[userindex][ 'pinicon' ] == 3) { marker[userindex] = new GMarker(user[userindex][ 'latlng' ], iconleader); } else { marker[userindex] = new GMarker(user[userindex][ 'latlng' ], iconuser); } for ( var i = 0; i < marker.length; i++) { if (marker[i] == undefined) continue ; var check_latlng = "" +marker[i].getLatLng(); if ((act_latlng == check_latlng) && (i != userindex)) { html_text[i] = html_text[i] + html_text[userindex]; marker[i].bindInfoWindowHtml(html_text[i]); marker.pop(); addmarker = 0; break ; } else { addmarker = 1; } } if (addmarker == 1) { map.addOverlay(marker[userindex]); bounds.extend(marker[userindex].getLatLng()); marker[userindex].bindInfoWindowHtml(html_text[userindex]); } if (userindex < maxindex) { createMarker(userindex+1, maxindex); } else { <?php if (GOOGLE_MAP_AUTOZOOM == 'TRUE' ) { ?> var newzoom = map.getBoundsZoomLevel(bounds); if (newzoom > <?php echo GOOGLE_MAP_MAXZOOM; ?>) { newzoom = <?php echo GOOGLE_MAP_MAXZOOM; ?>; } map.setZoom(newzoom); map.setCenter(bounds.getCenter()); <?php } ?> map.getInfoWindow().hide(); document.getElementById( 'gmUsersLoading' ).style.display = 'none' ; } } createMarker(0, user.length-1); </script> <?php $addtobodyend = ob_get_contents(); ob_end_clean(); $design ->addtobodyend( $addtobodyend ); $design ->footer(); ?> |
ich hab dann gedacht das ich einfach nur diese werte tauschen muss:
1 2 3 4 5 6 7 | switch (strtoupper(GOOGLE_MAP_TYPE)) { case "SATELLITE" : echo 'map.setMapType(G_SATELLITE_MAP);'; break; case "MAP" : echo 'map.setMapType(G_NORMAL_MAP);'; break; default: case "HYBRID": echo 'map.setMapType(G_HYBRID_MAP);'; break; |
und zwar hybrid mit map aber das funzt auch aber dann werden die pins nicht mehr angezeigt, hatte versucht dann noch mal neu im profil einzutragen aber es geht trotzdem nicht
verwendete ilchClan Version: 1.1