I am interested to add a preloader on the web page, cause i'm loading on the map a 15mb vector, so when all layers are loaded on the map i will hide the preloader.
I have found the rendercomplete
function in the API docs, how can i implement this?
something like
map.rendercomplete(function(){
//...
})
Vector:
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
url: 'getjson.json',
format: new ol.format.GeoJSON()
}),style:style_simple
});
Map:
var map = new ol.Map({
target: 'map',
layers: [roadlayer,vector],
controls: ol.control.defaults().extend([new ol.control.ScaleLine()]),
view: new ol.View({
center: ol.proj.fromLonLat([33.33386, 35.14710]),
zoom: 14,
maxZoom: 19
})
});