Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I was debating with one of my collegues on OpenLayers v/s Leaflet. I made a point that OpenLayers is much better API if we wish to build a project, where you need direct connectivity to the Geoserver and PostGIS.

Then I found Open Data Kit, which looks pretty new but has the features of connectivity with the Geoserver and PostGIS.

So my project details are as follows,

  1. Use the map interface to fetch Feature Info
  2. Create a customized tool that takes the lat/lon from user as to where he/she clicks on the map and then fetches the Climate Data from the raster (which is handled by a py script on the server)
  3. Allows user to upload excel, which is sent to the py script, which returns a GeoJSON, which creates Vector Features on the map
  4. Allow user to create vector polygons, which will fetch the Features it intersects from the WFS Layer.
  5. Fetches Layer from the PostGIS Datastore on GeoServer and displays the layers on the map.

So now I am confused on which is better and why using OpenLayers over Leaflet makes more sense or not?

share|improve this question
1  
Depends on the project. –  CaptDragon Sep 20 '12 at 16:55
1  
a. Improve your question by giving more details on the project. b. You are talking about direct connection to the database (postgis) for the users, are you sure? –  Pablo Sep 20 '12 at 17:06
    
sorry about that, updated my project details –  Sam007 Sep 20 '12 at 17:30
add comment

3 Answers 3

up vote 28 down vote accepted

I have used both OpenLayers and Leaflet in my apps. There has been so much discussion on this topic in this forum and others on planet-internet. They usually fall into 2 camps - features and flexibility of OpenLayers versus simplicity of Leaflet. I would not be surprised if someone spawns an "OpenLeaf" initiative soon marrying the best of both worlds!

I found Leaflet very simple to use, a petite 64K size, compared to over 700K Openlayers, and in very few steps you can create apps that have the freshness and eye-candy of today's web and mobile GIS apps. Your stack - GeoServer, PostGIS etc., is a standard stack, so OpenLayers or Leaflet could easily be incorporated.

Having said that, I would still go with OpenLayers for the following reasons

1) There is just a TON of material around OpenLayers. It is a lot more mature than Leaflet.

2) Check out the comparison on commits and users http://www.ohloh.net/p/compare?project_0=OpenLayers&project_1=Leaflet.

3) OpenLayers, GeoServer, PostGIS stack is so proven in the FOSS world that you are going on a path that is solid.

4) OpenLayers has tad bit more features on Map Controls http://lydonchandra.com/content/comparison-openlayers-vs-leaflets

5) While its a bit more work to create transitions and visual-effects, it can be done in OpenLayers.

Cheers,
Ramesh

share|improve this answer
1  
Also what about mobile devices? Which is better suited? –  Sam007 Oct 2 '12 at 15:35
1  
Yes. I am currently building mobile apps using OpenLayers and SenchaTouch. There are plenty of mobile map apps running on Openlayers. Here are some examples openlayers.org/dev/examples/?q=mobile. –  Ramesh Elaiyavalli Oct 2 '12 at 17:31
    
Thanks for the example will look into it –  Sam007 Oct 3 '12 at 4:53
add comment

I'd say check the API documentation for both. For me it seems that OpenLayers offers an extensive bunch of features, however the development/debugging time is longer.

Leaflet is sexier and much more easy going rather than the OL, however if you want to do a lot with your map, I think someday you might need a feature which is not implemented in Leaflet yet!

I really recommend to take a look at APIs! OpenLayers & Leaflet

Also you might need to consider that current stable release for Leaflet is 0.5.1 but it's 2.12 for OpenLayers.

P.S. If I want to develop a mobile application, I think I might go for Leaflet.

share|improve this answer
add comment

Leaflet all the way. I feel like Leaflet is the next step on the evolution of the open source tile based browser clients. Ka-Map -> OpenLayers -> Leaflet.

Leaflet is simple to use and does exactly what it says on the tin. OpenLayers has become bloated by trying to to be all things to all people, Leaflet does the 20% of things that are required 80% of the time.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.