How do I dynamically load the map?
When I try to use the GClientGeocoder(); on the initial page load the map
does not load..
var map = null;
var geocoder = null;
function initialize() {
if (GBrowserIsCompatible()) {
geocoder = new GClientGeocoder();
map = new GMap2(document.getElementById("map"));
map.setCenter(
geocoder.getLatLng(GetPoint('7805 new castle
ct, mckinney, tx'))<------------------I have removed the hard coded point to
the string address to simulate using the GetPoint function that I would use
, 13);
}
}
function GetPoint(point) { if (point) return point;
}<---------------Here is what I added
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 15);
var marker = new GMarker(point);
map.addOverlay(marker);
marker.openInfoWindowHtml(address);
}
}
);
}
}
Erik
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Sunday, November 23, 2008 11:01 AM
To: Google Maps API
Subject: Re: Extracting Longitude and Latitude from API.
On Nov 23, 8:34 am, how-can-i- do-it <[EMAIL PROTECTED]> wrote:
> Hello,
> I know that there is many questions about extracting longitude and
> latitude from API, but no one give me a real answer.
>
> I am a php developer and my javascript knowledge is very limited.
>
> Some one can give me please the complete code that give me Latitude
> and longitude values of an address.
>
> In fact i want to put this values in a php variable to use it later.
>
You will need to use the HTTP geocoder to get the coordinates on the
server if you want to use them in PHP:
http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direc
t
There may be a better way to do whatever it is that you are trying to
do.
-- Larry
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---