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.
http://cartagen.org/ too redundant for me.
SVG gives better performance with smaller number of objects or larger surface. Canvas gives better performance with smaller surface or larger number of objects. SVG is vector based and composed of shapes. Canvas is raster based and composed of pixel.
The HTML5 canvas has the potential to become a staple of the web, enjoying ubiquitous browser and platform support in addition to widespread webpage support, as nearly 90% of websites have ported to HTML5.
Difference between SVG and HTML5 Canvas: Canvas has poor scalability. Hence it is not suitable for printing on higher resolution. SVG gives better performance with smaller number of objects or larger surface. Canvas gives better performance with smaller surface or larger number of objects.
To draw SVG onto canvas, you need to use SVG image. Firstly, use the <foreignObject> element which contains the HTML. After that, you need to draw the SVG image into the canvas.
SVG would probably be easier to implement. I would look in to Raphael JS
Here is a relevant example of what raphael JS can do and how little code it takes
SVG world map definitions can be found numerous places, including Wikipedia, they shouldn't be too hard to search for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With