Looks like your code is using both Google and Yahoo geocoders. I'm guessing you didn't write this code?
Anyway, I'll echo what the other responders said, sand answer your title question: where is the AJAX code? Answer: the AJAX code which grabs the map tiles is in the API code, whether you are using Yahoo or Google maps APIs. If you are looking for code to load your own data from a remote server, then you must write that AJAX code yourself, or use someone else's code. Good luck, Mike Ethetton http://mastertoolworks.com http://mappingcenter.org On Aug 6, 1:41 pm, JRough <[email protected]> wrote: > http://192.168.1.40/~jlrough/workspace/soliant/googlemaparray.phpis > my map. > My question is where is the XMLHTTPrequest or if it isn't AJAX is it > just a file_get_contents() to get the map? I thought Google maps api > was using AJAX ? I have 2 different google map classes and I can't > find any XMLHTTPrequest in either of them. In one I found the > file_get_contents which I added below. And I have related question > if it is getting Google Maps api why does it say YahooDemo? The class > says Google Maps but it is accessing yahoo maps? > All the other functions in the classes look like they get the map > points, make up the addresses, parse the XML etc. Is the > XMLHTTPrequest in the Googlemap Javascript Framework that is why I > don't see it? > > $apiURL = "http://api.local.yahoo.com/MapsService/V1/geocode? > appid=YahooDemo&location="; > $addressData = file_get_contents($apiURL.urlencode($address)); > > Neither is the XMLHttpRequest in the script that accesses the classes > to create the maps? All I see there is these > 3 functions. The first one creates a map holder the second one is > below. I don't see any XMLHTTPrequests. > > THANKS, > > echo $gm->MapHolder(); > echo $gm->InitJs(); > echo $gm->UnloadMap(); > > function InitJs() { > $ret = ""; > # show error if misconfigured > $is_error = $this->CheckConf(); > if ($is_error) { > $ret = $is_error; > } else { > $cnt_add = count($this->mAddressArr); > > $color = $this->mIconColor[$this->mDefColor]; > $dir = $this->mIconStyle[$this->mDefStyle]['DIR']; > > $icon_w = > $this->mIconStyle[$this->mDefStyle]['ICON_W']; > $icon_h = > $this->mIconStyle[$this->mDefStyle]['ICON_H']; > > $icon_anchr_w = $this->mIconStyle[$this->mDefStyle] > ['ICON_ANCHR_W']; > $icon_anchr_h = $this->mIconStyle[$this->mDefStyle] > ['ICON_ANCHR_H']; > > $info_win_anchr_w = > $this->mIconStyle[$this->mDefStyle] > ['INFO_WIN_ANCHR_W']; > $info_win_anchr_h = > $this->mIconStyle[$this->mDefStyle] > ['INFO_WIN_ANCHR_H']; > > # start of JS SCRIPT > $ret .= "<script type=\"text/javascript\">\n"; > $ret .= "var gmarkers = [];\n"; > $ret .= "var address = [];\n"; > $ret .= "var points = [];\n"; > > $ret .= "if(GBrowserIsCompatible()) { \n"; > $ret .= " var map = new > GMap2(document.getElementById('map')); \n"; > > # handle map continuous zooming > $ret .= ($this->mContinuousZoom==TRUE)?" > map.enableContinuousZoom > (); \n":""; > > # handle map double click zooming > $ret .= ($this->mDoubleClickZoom==TRUE)?" > map.enableDoubleClickZoom > (); \n":""; > > # handle map controls > $mapCtrl = ""; > switch ($this->mDefControl) { > case 'NONE': > $mapCtrl = ""; > break; > > case 'SMALL_PAN_ZOOM': > $mapCtrl = "map.addControl(new > GSmallMapControl()); \n"; > break; > > case 'LARGE_PAN_ZOOM': > $mapCtrl = "map.addControl(new > GLargeMapControl()); \n"; > break; > > case 'SMALL_ZOOM': > $mapCtrl = "map.addControl(new > GSmallZoomControl()); \n"; > break; > > default; > break; > > } # end switch > $ret .= " $mapCtrl"; > > # handle map scale (mi/km) > $ret .= ($this->mScale==TRUE)?" map.addControl(new > GScaleControl > ()); \n":""; > > # handle map type (map/satellite/hybrid) > $ret .= ($this->mMapType==TRUE)?" > map.addControl(new GMapTypeControl > ()); \n":""; > > # handle map inset > $ret .= ($this->mInset==TRUE)?" map.addControl(new > GOverviewMapControl()); \n":""; > > $ret .= " var geocoder = new GClientGeocoder(); \n"; > $ret .= " var icon = new GIcon(); \n"; > $ret .= " icon.image = > 'http://google.webassist.com/google/markers/ > $dir/$color.png'; \n"; > $ret .= " icon.shadow = > 'http://google.webassist.com/google/markers/ > $dir/shadow.png'; \n"; > $ret .= " icon.iconSize = new > GSize($icon_w,$icon_h); \n"; > $ret .= " icon.shadowSize = new > GSize($icon_w,$icon_h); \n"; > $ret .= " icon.iconAnchor = new GPoint($icon_anchr_w, > $icon_anchr_h); \n"; > $ret .= " icon.infoWindowAnchor = new > GPoint($info_win_anchr_w, > $info_win_anchr_h); \n"; > $ret .= " icon.printImage = > 'http://google.webassist.com/google/ > markers/$dir/$color.gif'; \n"; > $ret .= " icon.mozPrintImage = > 'http://google.webassist.com/google/ > markers/$dir/{$color}_mozprint.png'; \n"; > $ret .= " icon.printShadow = > 'http://google.webassist.com/google/ > markers/$dir/shadow.gif'; \n"; > $ret .= " icon.transparent = > 'http://google.webassist.com/google/ > markers/$dir/{$color}_transparent.png'; \n\n"; > > # loop set address(es) > for ($i=$cnt_add-1; $i>=0; $i--) { > > $ret .= " var address_$i = {\n"; > $ret .= " infowindowtext: > '".addslashes($this->mInfoWindowTextArr > [$i])."',\n"; > $ret .= " full: > '".addslashes($this->mAddressArr[$i])."'\n"; > $ret .= " };\n\n"; > > $ret .= " address[$i] = > address_$i.infowindowtext;\n\n"; > > $ret .= " geocoder.getLatLng (\n"; > $ret .= " address_$i.full,\n"; > $ret .= " function(point) {\n"; > $ret .= " if(point) {\n"; > $ret .= " points[$i] = point; \n"; > $ret .= " map.setCenter(point, > {$this->mMapZoom});\n"; > $ret .= " var marker = new > GMarker(point, icon);\n"; > $ret .= " > GEvent.addListener(marker, 'click', function() {\n"; > $ret .= " > marker.openInfoWindowHtml(address_$i.infowindowtext); > \n"; > $ret .= " });\n"; > > $ret .= " > map.addOverlay(marker);\n"; > > # show only info window to the first set > address > if ($i===0) > $ret .= " > marker.openInfoWindowHtml(address_$i.infowindowtext); > \n"; > > $ret .= " gmarkers[$i] = > marker;\n"; > > $ret .= " }\n"; > $ret .= " else {\n"; > $ret .= " map.setCenter(new > GLatLng(37.4419, -122.1419), {$this->mMapZoom});\n"; > > $ret .= " }\n"; > $ret .= " }\n"; > $ret .= " ); // end geocoder.getLatLng\n\n"; > > } # end for > $ret .= "} // end if\n\n"; > > $ret .= "function sideClick(i) {\n"; > $ret .= " if (gmarkers[i]) {\n"; > $ret .= " > gmarkers[i].openInfoWindowHtml(address[i]);\n"; > $ret .= " > map.setCenter(points[i],{$this->mMapZoom});\n"; > $ret .= " } else {\n"; > $ret .= " var htstring = address[i];\n"; > $ret .= " var stripped = > htstring.replace(/(<([^>]+)>)/ig,''); > \n"; > $ret .= " alert('Location not found: ' + > stripped);\n"; > $ret .= " } /*endif*/\n"; > $ret .= "} /*end function */\n"; > > $ret .= "</script>\n"; > } # end if > > return $ret; > } # end function --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
