Tuesday 16 May 2017

Comparing various JavaScript mapping libraries?



I am working on a web-based mapping system and I'm trying to figure out which library to use.


These are links to comparisons of available libraries:



enter image description here



The list of libraries so far:



  • Google Maps

  • Microsoft Virtual Earth

  • MapQuest

  • Leaflet - "The comment smaller, faster, newer, and more straightforward can also be read as less features and less tested." -Geographika (see below)

  • ArcGIS API for JavaScript - Works best with ArcGIS Server (see below). Google Maps and Bing maps extensions are also available, letting you use the ESRI API with Google/Bing maps (though this is true of most libraries).

  • Yahoo Map API's

  • Via Michelin

  • OpenLayers - Extensive documentation and a good amount of functionality plus the ability to use different map providers.


  • Mapquery - MapQuery has been released and now has some useful documentation It has the very worthwhile goal of combining OpenLayers and jQuery. If you're particularly keen on the idea of OpenLayers + jQuery, or if you want to contribute to a JavaScript Mapping Library then get involved and contribute your efforts. However if you just want to be an end user, or are new to this area it may not be for you.

  • Mapstraction - Makes things very simple, especially working with multiple basemap providers. However it is still a work in progress and the functionality is lacking in places, as is the documentation. (E.g. "A GeoJSON object with the type “FeatureCollection” is a feature collection object." Not very informative.) It appears that it is still being actively developed but as of 4/4/11 there hasn't been a commit on Github since January.

  • deCarta - Has a mobile and desktop javascript - first is HTML5/CSS3 compliant and the second has more browser compatibility. Source code provided. Friendliest developer terms for a commercial API. You are allowed to brand the map and there are several different map styles. You can choose NAVTEQ or OSM data. They also have several Mobile APIs as well. - edited by TheSteve0 - a deCarta employee

  • Cloudmade

  • Polymaps - Makes it very easy to composite raster and vector data from many different sources. Lets you easily add your own colouring, grouping, and interaction. Runs quickly, manages background tile loading well, and is only 30k of Javascript. One potential down side: it uses SVG which means it does not and will not work in MSIE 7 or 8. It works great in every other browser and should work in IE9

  • Jump - jump is a light weight maps library that works on its own, meaning, it is not a wrapper for OpenLayers or GoogleMaps API. Currently it is under development, but a lot of essential features work well.

  • ModestMaps - Another smaller, faster, newer JS mapping library from the makers of Mapbox and TileMill.

  • Mapiator


OpenLayers is the one I am currently using. You can do a lot with it and it supports most data types. However it's not the best for everything. For example, Leaflet seems smoother in many ways, with image fading and other visual tweaks. If you're into jQuery you might like to check out MapQuery which is like a combination of jQuery and OpenLayers.




Answer






For non-GIS background devs creating single-function mapping apps - I'd probably recommend Leaflet (now supported by MapBox). Easy to use and small. More functionality relies on plugins of varying quality and support.


GIS online type application - use OpenLayers3 - has the full suite of data sources, controls etc. in a single library. It can also be used for simple mapping apps, so if you have a mix then I'd use this for everything.


Google still has the library/data combination (e.g. StreetView is not available anywhere else).


Esri has GUI web app builders, and as noted below, why complicate things if you already use their stack.


Commercial APIs (Google, Bing, Yahoo)



Using any commercial API leaves you at the mercy of whatever changes the provider makes to the API or Terms of Service. What happens for example if suddenly your local government portal that uses Google Maps suddenly has adverts popping up all over it? Want to reuse your JavaScript Google Maps code for an Intranet site? You'll find yourself having to pay the $10,000 licencing fee.


Microsoft often have more defined and fixed terms for their services (if paying) so there may be less of a risk here.


The recent backlash against Twitter is a good example of developers having an API that changed beneath them. If you aren't paying for a service then you (or your system) are the one being sold.


Google started charging for use of their maps from October 2011.


Esri


As others have mentioned if you are using an Esri stack then the ArcGIS API for JavaScript will no doubt work well on top of it. Coming from a GIS background Esri have probably thought more about traditional GIS tasks and features than the "neo-geography" web-giants (though this is just an opinion/feeling).


OpenLayers has built in support for ArcGIS REST layers, and if you are looking to reuse your code for non-ESRI based websites then again an open API serves you best.


Use OpenLayers...


I can't really think why developers would use an API other than OpenLayers. Open Source projects lead to related Open Source projects so there are a wealth of reusable components out there such as the GeoExt library, MapQuery, and GeoPrisma.


I'll just add that just because a project is Open Source does not automatically make it better than commercial equivalents - but the OpenLayers API matches the commercial competition in this case, and the ability to see how the source works, the unit tests, the build scripts etc. mean that you can easily build new features on top of it.



There has been some recent criticism of OpenLayers, mainly related to complexity, styling, and size. There have been counter-arguments made to these here and here by Christopher Schmidt one of the lead developers of OpenLayers.


It is worth noting that if you need a simple Open Source mapping API then take a look at Cloudmade's Leaflet.


The comment smaller, faster, newer, and more straightforward can also be read as less features and less tested.


Scan the API documentation for Leaflet and OpenLayers. The latter includes items such as WFS layers, editing tools, and SLD support. It has also been tested in many different environments, and works in IE6 (allowing government and local authority users).


For simpler display of spatial data Leaflet looks ideal, and easier to get started. However I'll be sticking with OpenLayers for more feature-rich GIS applications.


Caveats


One possible downside is often new innovations are seen first in commercial providers' systems - however these nearly always filter through to OpenLayers in time.


Finally I'm sure there are certain scenarios where other APIs are more suitable - on custom hardware, to fit in with an organisations other IT systems, or if you already know an API inside-out and can get a system developed in half the time.


All the APIs you mentioned are capable of producing great online mapping systems, but your choice should also fit in with you or your company's future development needs.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...