Posted by shawn.ready on 08/28/06 11:51
mich dobelman wrote:
> What's the common way to integrate php and google map api?
>
> I tried to create the getShop.php script which access the db and fetch
> the list of shops with lat and lon information in xml document. But without
> access? I thought this is not the common way to call the php script from
> javascript?
>
> any advice appreciated.
>
>
> var dom = new ActiveXObject("Msxml2.DOMDocument");
> dom.async = false;
> alert( "before call");
> dom.load("getShops.php?x1=" + bounds.minX + "&y1=" + bounds.minY + "&x2="
> + bounds.maxX + "&y2=" + bounds.maxY);
> alert( dom.xml );
> alert( "after call");
> var xml = GXml.parse(dom.xml);
> var markers = xml.documentElement.getElementsByTagName("marker");
> for (var i = 0; i < markers.length; i++) {
>
>
> var point = new GLatLng(
> parseFloat(markers[i].getAttribute("lat")),
> parseFloat(markers[i].getAttribute("lng"))
> );
>
> map.addOverlay(new GMarker(point));
> }
You might find this helpfull
http://mapki.com/wiki/AJAX_with_PHP_and_MySQL
Shawn
[Back to original message]
|