Wildsong / ol-react

React bindings for OpenLayers
MIT License
8 stars 2 forks source link

What are the main differences with react-openlayers ? #3

Open tompap opened 5 years ago

tompap commented 5 years ago

Hello,

I checked your project and https://github.com/SirMcPotato/react-openlayers (this specific fork which is based on ol@4.6.5)

the approach is nearly the same, but as you are working hard on your project. I wanted to know => If I should start working with your project or react-openlayers.

brian32768 commented 5 years ago

Probably almost everyone has more experience with JavaScript than me :-) so my opinion might not mean much.

I just refactored ol-react (again), this time to use Hooks and function components. Pretty much all of it is now using function components. My approach currently might or might not be the "best" way but it seems pretty clean and I understand it now.

I just cloned react-openlayers and looked at a bit of the code. It's probably fine but I've been marching down this path long enough now that I will push through to completion. I don't want to go back to using classes and lifecycles and all that.

I went with Parcel instead of webpack because it seems a lot simpler to me. I have been avoiding legacy packages like jquery. This is partly selfish on my part as I don't want to clutter my brain up with stuff that's no longer in vogue. I have successfully forgotten FORTRAN 77 and perl and don't see any reason to learn things that I will just want to forget in a year.

Since I have been working alone so far I have not been worried about maintaining branches or making demos work for other people (I use data that is behind firewalls currently) If you or anyone else wants to come on board I would give all that the attention it needs. Right now I just slam broken code in at the end of my work day, come home and do a pull and work another hour or two.

I am very close to doing another npm package release, maybe tomorrow? Then I will leave ol-react alone while testing it as a package for a week or two.

I switched to testing on the beta of openlayers 6 because that's what viglino/ol-ext is doing and I am using his code. It has been completely painless. So far.

Currently I am getting a handle on the CSS.

My requirement is to build a web mapping app for my county, so I am focused on getting what I need into ol-react to build that. I go rounds with ol-react then package it up and work on other parts of the complete project, like GeoServer and SOLR.

Some things have crept down from my app into ol-react like redux-first-router because it works so well. I thought I needed redux in ol-react but that all went away when I moved to Hooks. I think redux-first-router is only used in the example code now and there's no redux in ol-react itself.

tompap commented 5 years ago

Thanks for this complete answer :)

We will give a try to your solution and to react-openlayers, I will try as soon as possible to come back to you with feedback !