开发者

How do you set the initial viewing position of a webview?

In android, I am loading a large United States map from the web inside a webview.

The map is very large and what I would like to do is have the page pre-centered and possibly even pre-zoomed in on a certain part of the map.

For example, in an earlier part of my ap开发者_StackOverflow中文版p the user types in a zip code. I would like the webview to be autofocused on that area of the map.

Please don't suggest using google maps!


Afaik you want your map to be centered in pointed place. WebView exposes few methods which allow you to get current scale, zoom in/out and scroll. So you have to do some math and use them to scroll and zoom to certain part.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜