December 2017
Intermediate to advanced
260 pages
7h 34m
English
Here is the complete JavaScript with all bits and pieces together:
/* Configure Map */ // To configure center, zoom level and projection of the map var view = new ol.View({ zoom: 9 }); // Renders the map on the target div var map = new ol.Map({ // The target div to render map target: "map", // Visual representation of data from source layers: [ new ol.layer.Tile({source: new ol.source.OSM()}) ], controls: ol.control.defaults({ attributionOptions: ({ collapsible: false }) }), view: view }); /* Location */ var geolocation = new ol.Geolocation({ projection: view.getProjection() }); geolocation.on("error", function (error) { alert(error.message); }); // Set styling var positionFeature = new ol.Feature(); positionFeature.setStyle( ...
Read now
Unlock full access