Comments (13)
Yup, working on it.
from ol-geocoder.
I think dropping support for the openlayers
package in a major version is fine which leaves support for:
ol
package- hosted build (
ol.Map
etc.)
In ol3-layerswitcher I'm building a UMD bundle which supports the ol
package and the hosted build.
Currently the tests use the hosted build.
from ol-geocoder.
Fixed in #162. Thanks @aguynamedben @walkermatt
from ol-geocoder.
I've been doing some work moving the ol3-layerswitcher to use ol
package, see https://github.com/walkermatt/ol3-layerswitcher/issues/69. I think all plugins are going to need to move over to the ol
package shortly.
For ol-geocoder I think the change should be fairly simple; in the source import the individual classes from ol
instead of openlayers
then update rollup build to mark each ol class external and define globals for each similar to https://github.com/walkermatt/ol3-layerswitcher/blob/ol/rollup.config.js#L20-L28.
from ol-geocoder.
@niteshgoyal19 Are you able to provide a repro? Like a fiddle.
from ol-geocoder.
from ol-geocoder.
Sorry, don't have time to build this environment and discover what's happening.
from ol-geocoder.
Thanks for the time you spend working on ol-geocoder. Like @jonataswalker and @caseycesari I'm also running into this issue.
The stacktrace points to ./node_modules/openlayers/dist/ol.js:142. My project is attempting to use ol 4.6.4 via the modern ES2015+Webpack method linked to in the docs here. This is the only part of my project that is failing with Webpack.
I'll try to reproduce in a test repo so you can see what's going on. It seems that the ol/openlayers npm packages recommend using the ol
npm package for Webpack/Bowerify/ES6 usage, but using openlayers
for pre-built usage. My project is trying to use ol
, and it looks like ol-geocoder depends on openlayers
. Maybe there is some discrepancy with how the imports are happenings vs. the dist/ version. Ideally, I'd like none of my dependencies to use a dist/ version of OpenLayers. I want Webpack to package up the ES6 modules as needed.
@jonataswalker @caseycesari were y'all able to find any temporary workarounds?
I'll post here when I have a repo with a reproduction.
from ol-geocoder.
I'm curious if this issue would be fixed by depending on ol
instead of openlayers
, then changing the imports to the recommended ES6 way.
I.e. go from this style:
import ol from 'openlayers';
const layer = new ol.layer.Vector({
name: layerName,
source: new ol.source.Vector()
});
To this:
import SourceVector from 'ol/source/vector';
import LayerVector from 'ol/layer/vector';
const layer = new LayerVector({
name: layerName,
source: new SourceVector()
});
I'm an OpenLayers n00b, but from my read of the docs, that's how OpenLayers should be used in an ES6 environment. I think this would also not cause the dist/ import, making Webpack bundles that use ol-geocoder smaller.
Will reproduce, I'm curious what the maintainers think of that, though!
from ol-geocoder.
@jonataswalker I was able to reproduce in this small, simple repo: https://github.com/aguynamedben/ol-geocoder-152 details in the README. I'm curious what you think. Thanks for your time.
from ol-geocoder.
🙏 Thank you for looking at it. I'm not well-versed in OpenLayers or ol-geocoder, but I'm happy to help. I think I understand the process of moving to the ol
package because I had to do it in my project.
from ol-geocoder.
I'm stuck and I'll need some help, @walkermatt?
There are three scenarios:
ol
package dependency- works on browser
- works on project that depends on
ol
- doesn't work on unit tests (
test:unit
)- unit tests are done in a Node environment therefore
SyntaxError: Unexpected token import
- unit tests are done in a Node environment therefore
- no dependencies at all
- works on browser
- doesn't work on project that depends on
ol
ol
(used byol-geocoder
) isundefined
- works on tests
- unit tests are done with
openlayers
package
- unit tests are done with
openlayers
package dependency- the reason this issue was created
from ol-geocoder.
@jonataswalker Any update on migrating to the ol
package? I noticed some other plugins have done this now (walkermatt/ol-popup@494a42c).
Is it a matter of simply switching the imports in src/nominatim.js and src/base.js and changing the dependencies? I'm happy to take a stab at it if you think it's pretty straightforward.
from ol-geocoder.
Related Issues (20)
- Using Search Function Outside Div HOT 2
- TypeScript Typings, Exports
- Warning when using ol-geocoder from the CDN HOT 2
- Search Button - search does not work from smartphone if there is another text field HOT 6
- Remove search layer from legend HOT 3
- "countrycodes" option broken with array HOT 2
- Broken on Openlayers 7.1.0 HOT 23
- Limit search result to city HOT 2
- Allow custom URL for osm provider HOT 10
- URL for OSM provider is wrong HOT 1
- Init error on 4.2.0 HOT 3
- src/nominating.js better import on 4.2.0 HOT 1
- Error on bbox returned by nominatim.js 4.2.0 on Openlayers 7.4.0+ HOT 1
- Announcement: Transfer of Repository Ownership HOT 1
- How to customize original css style for geocoder text-input? HOT 5
- Tile layer is hidden by the marker layer in Openlayers 9.0.0 HOT 1
- SASS : Using / for division outside of calc() is deprecated
- keepOpen flag not working for Submit Button HOT 1
- The marker is an external dependency HOT 1
- mapquest API change HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ol-geocoder.