Hi Andrew
Thanks for the reply
I have tried adding the following statement map.setCenter(point) see
where below:-
GDownloadUrl("phpsqlajax_genxml3.php", function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName
("marker");
for (var i = 0; i < markers.length; i++) {
var name = markers[i].getAttribute("name");
var address = markers[i].getAttribute("address");
var type = markers[i].getAttribute("type");
var point = new GLatLng(parseFloat(markers[i].getAttribute
("lat")),
parseFloat(markers[i].getAttribute
("lng")));
var marker = createMarker(point, name, address, type);
map.addOverlay(marker);
map.setCenter(point);
This doesn't seem to render very smoothly is it not possible just to
take the variables from the lat,lng and center the map first before
the maker is added?
map.setCenter(new GLatLng(parseFloat(markers[i].getAttribute("lat")),
parseFloat(markers[i].getAttribute
("lng"))); /* this doesn't work though*/
By the way my JavaScript is none existent! As you have probably
guessed!
There is only ever going to one point on each map.
http://www.eatout.co.im/phpsqlajax_map.htm
Regards
Graham
On Jan 2, 9:05 pm, Andrew Leach <[email protected]> wrote:
> On Jan 2, 8:33 pm, "eatout.co.im" <[email protected]> wrote:
>
>
>
> > My question is how would I replace the static lat,lng value in:-
> > map.setCenter(new GLatLng(54.222385,-4.697412), 15);
> > with the parsed lat, lng values from the XML file which are being used
> > to set the point?
>
> Don't replace it. Add another line which resets the centre once you
> have defined "point".
>
> Andrew
--
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.