Skip to content

Instantly share code, notes, and snippets.

@MaxDragonheart
Last active January 8, 2021 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaxDragonheart/679a230a3fd3d851d7a9a80ae35a6b3a to your computer and use it in GitHub Desktop.
Save MaxDragonheart/679a230a3fd3d851d7a9a80ae35a6b3a to your computer and use it in GitHub Desktop.
Code for DirectOpenLayers
import './style.css';
import {
MapInizialized, MapSetView, BaseMapLayer,
wfsLayer
} from './directopenlayers';
const mapCanvas = new MapInizialized('map');
const mapCanvasView = new MapSetView(0, 90, 4);
const basemap = new BaseMapLayer('OSM');
const osm = basemap.createOSMStandard();
mapCanvas.addLayer(osm);
const wfsData = new wfsLayer(
'POLYGON',
'Buildings'
);
const vector = wfsData.createWFSLayer(
'https://gis.massimilianomoraca.it/geoserver/MassimilianoMoraca/wfs',
'geomedia_edificicasalnuovo',
'rgba(0, 0, 255, 1.0)',
null,
null,
0.5,
'rgba(0, 255, 0, 1.0)'
);
mapCanvas.addLayer(vector);
wfsData.zoomToExtent(50, 50, 50, 50, 5000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment