Html HTML5 Canvas 或 SVG 世界地图

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6104462/
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-29 08:44:43  来源:igfitidea点击:

HTML5 Canvas or SVG world map

htmlcanvasvectormapsvg

提问by Alexander Gryanko

I'm searching for open source implementation of world map for HTML5 Canvas or any JS library. I need simple vector world map with landscape and zoom. It would be good if it works on iOS/Android/BB OS.

我正在为 HTML5 Canvas 或任何 JS 库寻找世界地图的开源实现。我需要带有景观和缩放功能的简单矢量世界地图。如果它适用于 iOS/Android/BB 操作系统就更好了。

http://cartagen.org/too redundant for me.

http://cartagen.org/对我来说太多余了。

回答by Simon Sarris

SVG would probably be easier to implement. I would look in to Raphael JS

SVG 可能更容易实现。我会看看 Raphael JS

Here is a relevant exampleof what raphael JS can do and how little code it takes

这是raphael JS 可以做什么以及它需要多少代码的相关示例

SVG world map definitions can be found numerous places, including Wikipedia, they shouldn't be too hard to search for.

SVG 世界地图定义可以在很多地方找到,包括维基百科,它们不应该太难搜索。

回答by Ryan Rose

jVectorMap (http://jvectormap.com/) is a jQuery plugin that has built-in zooming and a nice world map example with an extensible events API and customization options. It uses SVG in all modern browsers like Firefox 3 or 4, Safari, Chrome, Opera, IE9, while offering legacy support for older versions of IE from 6 to 8 with VML. Really easy to use.

jVectorMap ( http://jvectormap.com/) 是一个 jQuery 插件,它具有内置缩放功能和一个带有可扩展事件 API 和自定义选项的漂亮世界地图示例。它在所有现代浏览器(如 Firefox 3 或 4、Safari、Chrome、Opera、IE9)中使用 SVG,同时使用 VML 为从 6 到 8 的旧版本 IE 提供旧版支持。真的很容易使用。

回答by Chris

Simon is right that Raphael.js is a good bet. Check out their world example at: http://dmitrybaranovskiy.github.io/raphael/

Simon 是对的,Raphael.js 是一个不错的选择。查看他们的世界示例:http: //dmitrybaranovskiy.github.io/raphael/

If you are looking for something built on Raphael, but with zooming/locations, a commercial option is: http://simplemaps.com/world

如果您正在寻找建立在 Raphael 上的东西,但有缩放/位置,一个商业选择是:http: //simplemaps.com/world

回答by Alexander Gryanko