Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v3' into v3
Browse files Browse the repository at this point in the history
  • Loading branch information
oterral committed Nov 19, 2024
2 parents 9039cc4 + 7cf0b57 commit 0ae2bc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions MIGRATION-V3.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Migration v3

The version contains a lot of breaking changes.
This version contains a lot of breaking changes.

Now we use the native api of OpenLayers and Maplibre to add/remove layers and controls it makes the library more flexible and easier to use.
The native OpenLayers and Maplibre APIs are now used to add/remove layers and controls. This makes the library more flexible and easier to use.

We also remove the dependency to `mapbox-gl` and use only `maplibre-gl` instead.
We also removed `mapbox-gl` dependency and use only `maplibre-gl` instead.

Here is an exhaustive list of what you have to change in your application code.
Here is an exhaustive list of what you need to change in your application code.

## exports

Expand All @@ -26,7 +26,7 @@ Here is an exhaustive list of what you have to change in your application code.
### for all Layer classes

Layers classes inherits now from `ol/layer/Base` directly.
So now native ol function like `setVisible()` are available directly on the layer.
Native ol functions like `setVisible()` are now available directly on the layer.

The `olLayer` property has been removed. Use the layer itself directly instead.

Expand All @@ -48,7 +48,7 @@ layer.attachToMap(map);
map.addLayer(layer);
```

All custorm properties must be send at the root level of the options, not into a `properties` property
All custom properties must be sent at the root level of the options, not into a `properties` property

```js
// Before:
Expand All @@ -67,7 +67,7 @@ const layer = new Layer({
### for all Control classes

Controls classes inherits now from `ol/control/Control` directly.
So now native ol functionnalities are available directly on the layer.
Native ol functionalities are now available directly on the layer.

To add a control use the `addControl()` method of the map instead of the `attachToMap()` method of the control.

Expand All @@ -83,7 +83,7 @@ map.addControl(control);

### for all Layer classes

Layer classes inherits now from [`Evented`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Evented/) and implements the [`CustomLayerInterface`](https://maplibre.org/maplibre-gl-js/docs/API/interfaces/CustomLayerInterface/).
Layer classes now inherit from [`Evented`](https://maplibre.org/maplibre-gl-js/docs/API/classes/Evented/) and implement the [`CustomLayerInterface`](https://maplibre.org/maplibre-gl-js/docs/API/interfaces/CustomLayerInterface/).

To add a layer use the `addLayer()` method of the map instead of the `attachToMap()` method of the layer.

Expand All @@ -95,7 +95,7 @@ layer.attachToMap(map);
map.addLayer(layer);
```

We also have removed the onClick, onHover properties. Because we never used it.
We also have removed the onClick, onHover properties, since we never used them.

```js
// Before:
Expand Down
4 changes: 2 additions & 2 deletions doc/public/static/examples/ol-realtime.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="map" style="width: 100%; height: 100%;"></div>
<div style="padding:0.5em;position:absolute;top:.5em;right:.5em;max-height:calc(100% - 4.2em);max-width:35%;background-color:white;border-radius:.5em;display:flex;">
<pre id="content" style="margin:0;overflow:auto;font-size:.7em;">Click on a moving vehicle to see informations</pre>
</div>
<pre id="content" style="margin:0;overflow:auto;font-size:.7em;">Click on a moving vehicle to see information</pre>
</div>

0 comments on commit 0ae2bc9

Please sign in to comment.