在谷歌地图绘制长路径提高性能 [英] Improving performance on google maps drawing long paths

查看:207
本文介绍了在谷歌地图绘制长路径提高性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是不同的比这另一个
所以,我一直在观察了谷歌原生地图应用时,它在地图上绘制还很远。

This question is different than this another one So, I have been observed the native google maps app when it draw long ways on the map.

当变焦太远,线条不饱满的细节......我的意思是,当我们使用谷歌地图API,并要求两个不同点之间的路径,我们收到了整个坐标绘制最详尽的路径在地图上。

When the zoom is too far, the lines are not full of details ... I mean, when we use the google maps api and request for a path between two different points we receive the whole coordinates for draw the most detailed path on the map.

当我们改变缩放绘制的线条得到更多的细节。

As we change the zoom the drawn lines receive more details.

问题是。有没有办法做类似原生谷歌地图应用程序?我们可以要求较少的细节绘制使用谷歌地图API在地图上的路径?我们可以改善的细节绘制的线条,因为我们改变变焦?

The question is. Is there a way to do something like the native google maps app ? Can we ask for less details to draw the path on the map using google maps api ? Can we improve the lines drawn details as we change the zoom ?

如果答案是不我所有的问题,在这里你去另外一个:我们怎样才能画在地图上的长路径无滞后的问题。

If the answer is "no" for all of my questions, here you go another one: How can we draw a long path on map without lag issues ?

我希望我已经清楚,对不起我的英语。

I hope I've be clear, sorry about my English.

推荐答案

谷歌地图可能是由服务器生成的路径的位图。一个新的每一个缩放级别。

Google Maps is probably a bitmap of that path generated by the server. A new one for every zoom level.

您可以做同样的事情,但它是相当一些工作。但它应该是更快地生成一个透明位图一次,而每个视图需要刷新的时间绘制的路径。您也可以绘制路径与减少的细节,如果你直接跳过一些点,但找到一个算法,不跳过的重要组成部分是相当棘手的。

You can do something similar but it's quite some work. But it should be faster to generate a transparent bitmap once instead of drawing the path each time the view needs to refresh. You can also draw a path with reduced details if you simply skip some points but finding an algorithm that does not skip the important parts is quite tricky.

这篇关于在谷歌地图绘制长路径提高性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆