基于 Web (ASP.Net) 应用程序的离线地图
我正在开发一个基于网络的应用程序,我需要在每个国家或城市覆盖一些颜色层。我知道我可以使用 Google 地图,但我遇到的问题是我们部署应用程序的服务器无法访问互联网。 所以我需要一个像谷歌地图这样的地图组件,我可以离线使用它,有人可以建议我可以使用的任何组件吗?
I'm developing a web based application where I need to overlay some color layers over each country or city . I know that I can use Google maps but the problem I have is that the server where we're deploying the app doesn't have access to the internet .
so I need a map component like Google maps which I can use it offline , can any one suggest any component that I can use ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以查看openstreetmap。在那里,您可以下载全世界的planet.xml 文件,或仅下载您想要服务的区域的特定文件。也可以在这里找到好的材料:www.geofabrik.de
然后,您将必须设置自己的tileserver,它将对提供的xml文件进行png-tiles处理,并将所有png-maps存储在您的本地硬盘上。
tileserver 可能也会有一些 web-api。因此,您的tileserver可能在localhost:8080或其他端口上运行,而您的网站可能在端口80上的apache上运行。
然后您将使用一些网络框架来访问您自己的tileserver。这个框架将是
可能是 http://openlayers.org/ 它也可以在地图上绘制形状。
作为tileserver-location,您可以将地址添加到本地安装的tileserver。然后 Openlayers 将接收压碎的瓷砖并用它做一些事情。
因此,您必须至少从互联网 (planet.xml) 获取一些信息并处理您的数据。但请注意,这种处理可能需要很长时间,具体取决于您想要服务的国家/地区数量,而且这些 png 文件将占用大量空间。
查看 openstreetmap.org 如何执行所有这些操作,包括一些数字。
也许甚至可以从 openstreetmap 下载经过处理的图块,并将它们按特定顺序排列,然后启动指向这些图块的图块服务器。这可能会容易得多。
您无法下载 Google 地图图块并在您自己的图块服务器中提供它们,因为它们存在许可证限制。
问候,
简
You might check out openstreetmap. There you could download the planet.xml file for the whole world or specific files only for the regions you want to serve. Good material can be found also here: www.geofabrik.de
Then you will have to set up your own tileserver, which will crunch png-tiles for the xml-files provided and store all png-maps on your local harddrive.
The tileserver will probably have some web-api also. So your tileserver may run on localhost:8080 or another port, and your website runs maybe on apache on port 80.
Then you would use some web-framework to access your own tileserver. This framework would be
probably http://openlayers.org/ which can also draw shapes onto maps.
As a tileserver-location, you would add the address to your local installed tileserver. Openlayers will then receive the crunched tiles and do some stuff with it.
So, you have to at least once get some information from the internet (planet.xml) and crunch your data. But be aware that this crunching might take a long time depending on how many countries you want to serve and also these png-files will take a lot of space.
Check out openstreetmap.org how to do all this, including some numbers.
Maybe it is even possible just to download the crunched tiles from openstreetmap and put them in a specific order and fire up a tileserver pointing to these tiles. This would probably much easier.
You cannot download the Google-Maps tiles and serve them in your own tile-server, since there is a license restriction on them.
Greetings,
Jan
您会发现这很困难,因为仅地图数据就可能占用数百兆字节的存储空间。 操作系统在英国境内提供离线地图,免费提供,但它是有限的,您必须手动将其集成到您的网站中。
拥有一个无法访问互联网的基于网络的应用程序对我来说似乎有点愚蠢,肯定有办法解决这个问题吗?
You're going to find that difficult because the map data alone could take up several hundred megabytes of space to store. The OS provides offline mapping within the UK which they provide free but it is limited and you'll have to manually integrate it into your site.
Having a web-based application that can't access the internet seems a bit daft to me, surely there's a way around that?