ol-geocoder
ol-geocoder copied to clipboard
Broken on Openlayers 7.1.0
Since updating to latest OL 7.1.0 i get the following error in the console:
Uncaught TypeError: class constructors must be invoked with 'new'
Yea getting the same error and Geocoder is not a constructor
Same thing happened with ol-layerswitcher. The solution seems to be removing the webpack transpiling ES6 classes to ES5. Would be great if anyone can make a PR. Can take a look at this commit for reference.
Workaround: Use ol-geocoder-debug.js and replace line 1134 by: return new Control({ element: this.container });
I am working on the issue. The Base class in base.js calls super after accessing "this" which throws an error in ES6. Trying to refactor that.
EDIT: Done with this. ol-geocoder will now ship with ES6 classes. Will make a PR. Only issue I'm facing now is that the magnifying glass is not visible on the button since OL7 has default white background for colors. Will try to change color of magnifying glass.
Something in there ? https://stackoverflow.com/questions/51860043/javascript-es6-typeerror-class-constructor-client-cannot-be-invoked-without-ne
@Dominique92 perhaps try disabling transpiling by commenting out the buble plugin in https://github.com/jonataswalker/ol-geocoder/blob/master/build/config.js#L54
I am working on the issue. The Base class in base.js calls super after accessing "this" which throws an error in ES6. Trying to refactor that.
EDIT: Done with this. ol-geocoder will now ship with ES6 classes. Will make a PR. Only issue I'm facing now is that the magnifying glass is not visible on the button since OL7 has default white background for colors. Will try to change color of magnifying glass.
Thanks for taking a look into it and fixing it :)
@Dominique92 perhaps try disabling transpiling by commenting out the buble plugin in https://github.com/jonataswalker/ol-geocoder/blob/master/build/config.js#L54
Already did that. It works. Making up a PR after upgrading to v7 in examples
EDIT: PR is made. Please review it. #259
@Dominique92 perhaps try disabling transpiling by commenting out the buble plugin in https://github.com/jonataswalker/ol-geocoder/blob/master/build/config.js#L54
Already did that. It works. Making up a PR after upgrading to v7 in examples
EDIT: PR is made. Please review it.
Can't download your repo using npm install
getting errors with node-sass if installing with "no optional". If I do normal install it gets stuck at fsevents.
I'm able to run npm i
after cloning the repo.
I'm able to run
npm i
after cloning the repo.
I am not sure what is happening with my npm install https://github.com/kirtan-desai/ol-geocoder.git
stops with fsevents install and hangs there. npm install https://github.com/kirtan-desai/ol-geocoder.git --no-optional
leaves me with node-sass errors Idk why...
Anyway, it seems to me more logical to call super first, then to use this:
Doing this:
...
this.layer = $nominatim.layer;
super({ element: this.container });
}
If the parent constructor initialize this.layer, you will get his value.
is not the same than:
{
super({ element: this.container });
this.layer = $nominatim.layer;
...
you will get your value
Example : https://github.com/openlayers/openlayers/blob/main/src/ol/control/FullScreen.js#L81-L97
I'm able to run
npm i
after cloning the repo.I am not sure what is happening with my
npm install https://github.com/kirtan-desai/ol-geocoder.git
stops with fsevents install and hangs there.npm install https://github.com/kirtan-desai/ol-geocoder.git --no-optional
leaves me with node-sass errors Idk why...
installing with npm directly is also working for me. why don't you try cloning the repo and running it?
@Dominique92 Did you take a look at my PR #259?
@Dominique92 Did you take a look at my PR #259?
Sorry ! It's super :) Awaiting the dist (I don't use npm)
@Dominique92 Did you take a look at my PR #259?
Sorry ! It's super :) Awaiting the dist (I don't use npm)
Just clone my repo, run npm i
and then run npm run build
. You'll get the files in dist folder.
Just clone my repo, run
npm i
and then runnpm run build
. You'll get the files in dist folder.
Sorry, I use Windows where npm is a mess, not linux I will wait the dist
Just clone my repo, run
npm i
and then runnpm run build
. You'll get the files in dist folder.Sorry, I use Windows where npm is a mess, not linux I will wait the dist
I don't know when my PR will be reviewed. Till then, here are the dist files. Let me know if there's any issue.
Till then, here are the dist files. Let me know if there's any issue.
Thank you. This dist works perfectly for me.
Is this repo maintained anymore? Should I publish a package of my forked repo as ol-geocoder v5?
Hey guys, I have published my forked repo of ol-geocoder which is compatible with openlayers 7. I'll be maintaining the fork. https://www.npmjs.com/package/@kirtandesai/ol-geocoder
Hi guys,
It's my first post... please be kind ;) Sorry to bother you but seems to me that the magnifying glass does not match very well with the new layout so, on my local copy, I've changed the base64 on the css with the following: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAThJREFUOE+VkttxwkAMRXXN4NVf3AGkgtBBSAeUYDpIKog7CCU4FQQqgBJMB5SQ/Gn9WGXE2BnGNhnYrx1pz9XjLujiMPO8ruuZheq6PhLR92W+f0cbSOI4/gCQEtFPG3sgoo33/u2awBlm5oOqJiGEtKqqwmLT6XQxmUy2IYR9WZbrMQEwc6qqVmHeb9PGUNUCwEpEDoO2nXNbIjp571/H1C0PoBCRbABby0R0GEvaY+fchojm3vvVGJzbvGPJFra2t9cqL1V1D+ClP1ccxysAXwAeReQ0ahUzZ6r6rqpZCOG8mCiKlgAyAJ8iYhYOTucztVVsKU/tq52q5q3ApmmaorOxU/mD//lJCTMXqjoDsBaR/B64+0TPBl0K3FLZmMQ5Z7s4j9QJ3Ar3BY7e+8U9cCdgjuS2vF+pr50QDmmCjgAAAABJRU5ErkJggg=='
it is simply the 'original' with reverted colors. If you like it please feel free to use.
Massimo
Hi guys,
It's my first post... please be kind ;) Sorry to bother you but seems to me that the magnifying glass does not match very well with the new layout so, on my local copy, I've changed the base64 on the css with the following: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAAXNSR0IArs4c6QAAAThJREFUOE+VkttxwkAMRXXN4NVf3AGkgtBBSAeUYDpIKog7CCU4FQQqgBJMB5SQ/Gn9WGXE2BnGNhnYrx1pz9XjLujiMPO8ruuZheq6PhLR92W+f0cbSOI4/gCQEtFPG3sgoo33/u2awBlm5oOqJiGEtKqqwmLT6XQxmUy2IYR9WZbrMQEwc6qqVmHeb9PGUNUCwEpEDoO2nXNbIjp571/H1C0PoBCRbABby0R0GEvaY+fchojm3vvVGJzbvGPJFra2t9cqL1V1D+ClP1ccxysAXwAeReQ0ahUzZ6r6rqpZCOG8mCiKlgAyAJ8iYhYOTucztVVsKU/tq52q5q3ApmmaorOxU/mD//lJCTMXqjoDsBaR/B64+0TPBl0K3FLZmMQ5Z7s4j9QJ3Ar3BY7e+8U9cCdgjuS2vF+pr50QDmmCjgAAAABJRU5ErkJggg=='
it is simply the 'original' with reverted colors. If you like it please feel free to use.
Massimo
Hey Massimo, feel free to make this a PR on my fork!