I have built a simple open-layers -3 map ,see below for code:
HTML code:
CSS :
#map{ width:100%; height:800px; } Openlayers map initialization code:
var map; function init(){ map = new ol.Map({ target:'map', renderer:'canvas', view: new ol.View({ projection: 'EPSG:900913', center:[-8015003.33712,4160979.44405], zoom:5 }) }); var newLayer = new ol.layer.Tile({ source: new ol.source.OSM() }); map.addLayer(newLayer); } Now my map loads just fine, what i would really like to do is , I would like to have only a specific area loaded , for which i need a bounding box , i would like to load the the bounding box for THIS area. But i am new to openlayers-3, so i tried and i just could't make the bounding box , can somebody help me make the bounding box please ?
Thank you.
Alex-z
أكثر...
HTML code:
CSS :
#map{ width:100%; height:800px; } Openlayers map initialization code:
var map; function init(){ map = new ol.Map({ target:'map', renderer:'canvas', view: new ol.View({ projection: 'EPSG:900913', center:[-8015003.33712,4160979.44405], zoom:5 }) }); var newLayer = new ol.layer.Tile({ source: new ol.source.OSM() }); map.addLayer(newLayer); } Now my map loads just fine, what i would really like to do is , I would like to have only a specific area loaded , for which i need a bounding box , i would like to load the the bounding box for THIS area. But i am new to openlayers-3, so i tried and i just could't make the bounding box , can somebody help me make the bounding box please ?
Thank you.
Alex-z
أكثر...