Skip to content

Instantly share code, notes, and snippets.

@MaxDragonheart
Created January 3, 2021 09:39
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/04e7cf4343a9991f7f11efc17b145fe5 to your computer and use it in GitHub Desktop.
Save MaxDragonheart/04e7cf4343a9991f7f11efc17b145fe5 to your computer and use it in GitHub Desktop.
Code for DirectOpenLayers
import './style.css';
import {
MapInizialized, MapSetView, BaseMapLayer,
MapFullScreen, MapScaleLine, vectorsLayer
} from './directopenlayers';
const mapCanvas = new MapInizialized('map');
const mapCanvasView = new MapSetView(14.350, 40.905, 5);
const basemap = new BaseMapLayer('Test');
const osm = basemap.createOSMStandard();
mapCanvas.addLayer(osm);
const pointData = new vectorsLayer(
'point',
'https://massimilianomoraca.it/api/geomedia/attention-points/',
'Points'
)
const renderPointData = pointData.createVector(
'rgba(255,0,0,0.5)', null, null, 2, 'rgba(49,130,189,1.0)',
20, 0, 13
);
mapCanvas.addLayer(renderPointData);
pointData.zoomToExtent(50, 50, 50, 50, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment