camptocamp / inkmap

A library for generating high-quality, printable maps on the browser.
Other
86 stars 17 forks source link

UPDATE to OpenLayers v9.1.0 & ADD BingMaps type of Layer & Async behaviour #66

Closed neo-garaix closed 2 weeks ago

neo-garaix commented 6 months ago

This PR is the following part of the issue #65

BingMaps Layer

I added a new type of layer. This is the BingMaps one from OpenLayers v9.1.0 to fit with workers. Due to the different ways BingMaps objects work, I needed to add a await fetch() in my createLayerBingMaps(...) function in order to make it works properly. So, I changed the way a job is waiting.

Async Behaviour

Now the createLayer(...) function is async so I can use await on the BingMaps function.

I changed a little bit the way job.js works by replacing the assignement of layerStates$ with await Promise.all(...)

And changed the construction of tests which weren't async

jahow commented 6 months ago

Thank you for this awesome contribution! I unfortunately didn't have the time yet to review it but will do it ASAP. I was a bit surprised to see an observable emitting a promise, although I definitely see the point of having async functions. There might be a better way to handle this, I'll look into it more.

neo-garaix commented 4 months ago

Hello ! I added the BingMaps Internal function like you asked. Don't hesitate to tell me if there's something wrong.

jahow commented 3 months ago

Hi @CrYzSnow , thanks for committing to this! I will give it a review ASAP, sorry for taking that long!

neo-garaix commented 1 month ago

Hello ! I've got a new occasion to use Inkmap with these modifications. It would be great if you could review it when you have time. I'm using it to print maps in LizmapBuilder and, at the moment, we directly embed this modified Inkmap. In the future, we will put it in package.json. Thanks !