开发者

Display the map without submiting the address (Google MAP API V3)<

开发者 https://www.devze.com 2023-02-10 23:20 出处:网络
In this example! Online Demo: http://code.google.com/apis/maps/documentation/javascript/examples/geocoding-simple.html

In this example!

Online Demo:

http://code.google.com/apis/maps/documentation/javascript/examples/geocoding-simple.html

Or

http://code.google.com/开发者_运维知识库apis/maps/documentation/javascript/v2/examples/geocoding-simple.html

You get the map when you put the city or the address manually and click on submit bottom.

Is there a way to give the address without add it in the form and submitting it?p .

I get my address from SQL table and want to show the map without any submitting


Maybe you mean geocoding?


Sure, you can easily tweak the code in the example to get the address from a variable rather than from the form field.

That said, if you've got alot of addresses you wish to show, you will be much better off pre-caching the geocodes than requesting the coding on the fly for a few reasons. First, user-experience-wise, it will be alot quicker because you are removing an entire blocking remote request from the system. Second, the client-side geocoding has a number of rate limitations so it is not reliable if you wish to throw a dozen or so addresses at it at once. Trust me, I learned that one the hard way.

0

精彩评论

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