开发者

Passing LatLng object into javascript?

I am using php to write out an html file, similar to a user profile, that contains a google map centered at the profile's address.

I know that the latitude/longitude is returned in latlng object format. Can I just parse this object out of the json using php, and pass it directly into the javascript, or is it not possible for php to pass this object? Furthermore, can this information be stored in an sql database (without using fusion table)?

edit: so if I had

    $geoadd = $address.','.$city.','.$state.',开发者_如何学运维'.$zipcode.',USA';
    $geoadd = urlencode($geoadd);
    $url = "http://maps.googleapis.com/maps/api/geocode/output?address=".$geoadd;
    $json_response = json_decode($url, TRUE);

I'd just pass $json_response into javascript?


You should make use of an ajax call and parse the gocoder responce in there.Just make use of jquery ajax call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜