ol-glmp
v1.0.1
Published
A library for rendering massive data based on openlayer
Downloads
3
Readme
ol-glmp
A library for rendering massive data based on openlayer
Browser Support
| | | | | | --- | --- | --- | --- | --- | --- | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | 11 ✔ |
Installing
Using npm:
npm install ol-glmp
Example
Load a layer
import WebGLayer from "ol-glmp/layer/WebGLPolygon";
import Webc from "ol-glmp/source/Webc";
let layer = new WebGLayer({
source: new Webc(),
style: {
// color setting '#fff' or 'rgb(255,255,255)' or 'rgba(255,255,255,1)'
color: "#ff0000"
}
});
// Openlayer add layer see https://openlayers.org/
var vectorSource = new Webc({
loader: function(extent, resolution, projection) {
var proj = projection.getCode();
vectorSource.addFeatures(
//Geojson data
vectorSource.getFormat().readFeatures( data , {
featureProjection: projection
})
);
}
});
layer.setSource(vectorSource);
map.addLayer(layer);