openlayers icon indicating copy to clipboard operation
openlayers copied to clipboard

React Native Support

Open easybakechef opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. openlayers does not work with React Native because it depends on the "document" concept (and maybe for more reasons). As a developer I'd like to be able to use openlayers in my react native app.

Describe the solution you'd like The ability to use openlayers in react native.

easybakechef avatar Aug 16 '22 02:08 easybakechef

Can you provide a minimal example of the code you are trying to run and describe what you expect it to do? Not all of OpenLayers relies on the DOM.

tschaub avatar Aug 16 '22 18:08 tschaub

Hi

I had the same problem trying to show a map with openlayer on React Native / Android app

    this.olMap = new OLMap({
        layers: [
            new TileLayer({
                source: new XYZ({
                    url: this.sourceUrl,
                    maxZoom: 19
                })
            }),
            new VectorLayer({source: new Vector({features: []})})
        ],
        view: this.view,
        target: this.target
    });
    

First problem was the dependency to fs, that I solved by doing a patch / removing the GeoTiff feature. But the whole map display seems to be relying on documents and div, so it will be so much more complicated to do :/

BourotBenjamin avatar Oct 19 '23 23:10 BourotBenjamin