Merge pull request #11215 from ahocevar/flat-multipolygon
Fix MVT multipolygons with featureClass: Feature
This commit is contained in:
BIN
rendering/cases/format-mvt-geojson/expected.png
Normal file
BIN
rendering/cases/format-mvt-geojson/expected.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.7 KiB |
47
rendering/cases/format-mvt-geojson/main.js
Normal file
47
rendering/cases/format-mvt-geojson/main.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import {Feature, Map, View} from '../../../src/ol/index.js';
|
||||
import {GeoJSON, MVT} from '../../../src/ol/format.js';
|
||||
import {VectorTile as VectorTileLayer} from '../../../src/ol/layer.js';
|
||||
import {VectorTile as VectorTileSource} from '../../../src/ol/source.js';
|
||||
import {fromLonLat} from '../../../src/ol/proj.js';
|
||||
|
||||
const center = fromLonLat([0.26, 24.08]);
|
||||
|
||||
const map = new Map({
|
||||
layers: [
|
||||
new VectorTileLayer({
|
||||
source: new VectorTileSource({
|
||||
format: new MVT(),
|
||||
url: '/data/{z}-{x}-{y}.mvt',
|
||||
minZoom: 7,
|
||||
maxZoom: 7,
|
||||
}),
|
||||
}),
|
||||
new VectorTileLayer({
|
||||
source: new VectorTileSource({
|
||||
format: new MVT({
|
||||
featureClass: Feature,
|
||||
}),
|
||||
url: '/data/{z}-{x}-{y}.mvt',
|
||||
minZoom: 7,
|
||||
maxZoom: 7,
|
||||
}),
|
||||
}),
|
||||
new VectorTileLayer({
|
||||
source: new VectorTileSource({
|
||||
format: new GeoJSON(),
|
||||
url: '/data/{z}-{x}-{y}.geojson',
|
||||
minZoom: 7,
|
||||
maxZoom: 7,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
target: 'map',
|
||||
view: new View({
|
||||
center: center,
|
||||
zoom: 10,
|
||||
}),
|
||||
});
|
||||
|
||||
map.getTargetElement().style.background = 'gray';
|
||||
|
||||
render();
|
||||
Reference in New Issue
Block a user