how to load image as base layer for further drawing in openlayer 3 -
how load selected image base layer further features point/polygon/shape draw onto it. of examples shown on openlayer website, using "ol.source.osm" base layer source. don't want use osm based layer.
an example of loading custom images can found in openlayers site, under image load event.
you have take care format of picture want load. didn't provide more information, use single, untiled image wms server.
the following snippet part of code should you.
var map = new ol.map( { layers: [ new ol.layer.image( { source: new ol.source.imagewms( { url: 'https://ahocevar.com/geoserver/wms', params: { 'layers': 'topp:states' }, servertype: 'geoserver' } ) } ) ], target: 'map', view: new ol.view( { center: [-10997148, 4569099], zoom: 4 } ) } );
<script src="https://openlayers.org/en/v3.20.1/build/ol.js"></script> <div id="map"></div>
Comments
Post a Comment