Javascript 离线使用谷歌地图(Js Api)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33235835/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 14:49:15  来源:igfitidea点击:

Using Google Maps offline (Js Api)

javascriptnode.jsgoogle-mapsgoogle-maps-api-3

提问by iyogeshjoshi

I'm trying to make an NodeJs App in which, on web page I'm using Maps, For some reasons I've chosen Google Mapsand I want to stick to it. My question is, Is there anyway where I can either store or cache map tiles offline and later on use it as needed [Note: Not looking for any hack or Illegalway for it, I already know there are many such ways].

我正在尝试制作一个 NodeJs 应用程序,在该应用程序中,我在网页上使用地图,出于某些原因,我选择了谷歌地图,我想坚持下去。我的问题是,无论如何我可以离线存储或缓存地图图块,然后根据需要使用它[注意:没有寻找任何黑客或非法方式,我已经知道有很多这样的方式]。

I tried and saw many options like GEE (Google Earth Enterprise) portable but I guess they are shutting it down very soon i.e by 2017.

我尝试并看到了许多选项,例如 GEE(Google Earth Enterprise)便携版,但我猜他们很快就会关闭它,即到 2017 年。

Basically what I'm trying here is to minimize the data usage on rendering map tiles, so alternatively, if there ain't a way to make google map work offline any suggestion or advice for minimizing data usage is appreciated.

基本上,我在这里尝试的是尽量减少渲染地图图块的数据使用量,因此,如果没有办法让谷歌地图离线工作,任何减少数据使用量的建议或建议都值得赞赏。

回答by xomena

The offline access via Maps JavaScript API is not available at the moment. There is a feature request in the public issue tracker:

目前无法通过 Maps JavaScript API 进行离线访问。公共问题跟踪器中有一个功能请求:

https://issuetracker.google.com/issues/35827808

https://issuetracker.google.com/issues/35827808

Please star this feature request to express your interest and receive further updates from Google.

请在此功能请求上加注星标以表达您的兴趣并接收来自 Google 的进一步更新。

回答by build-1

1.Use Localstorage instead it might help but will be used in google chrome. 2.Check this url it might help How to cache Google map tiles for offline usage?

1.改用Localstorage它可能会有所帮助,但会在谷歌浏览器中使用。2.检查这个网址可能有帮助如何缓存谷歌地图图块以供离线使用?