Walrus
Walrus

Reputation: 20444

Set location of google map API

The following is a Jquery implementation of the google map API.

We have a working direction system but I want to have the map start in the position of the post code of the current property being viewed. How do you tell the map where to start its focus from. At the moment it is Washington DC every time.

 <script src="http://maps.google.com/maps?file=api&v=2&sensor=true&language=en&key=ABQIAAAAGcPGjX-izBm12MfKVJQDMxSFrT_-MTFIAEBcsBZKaMY6Nh6WHBSpGsVLM4GSyvhPjinVSeDePWTZww" type="text/javascript"></script>

I assume there is a parameter needed. Something like &location=S173NE for example.

Upvotes: 0

Views: 1886

Answers (1)

no.good.at.coding
no.good.at.coding

Reputation: 20371

It doesn't look like this is possible when loading the Maps API; you must do it via JavaScript once the map has been loaded using something like the example shown on the documentation page:

var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);

Upvotes: 1

Related Questions