0
I have a constructor and I wanted to create an object from it. But, ta giving Uncaught Typeerror: Map is not a constructor.
I just wanted to know why?
var mapa = null;
var Map = (function (ol, $) {
function Map(paramsMap) {
this.layers = {};
this.overlayes = {};
this.olMap = new ol.Map(paramsMap);
}
Map.prototype.getResolution = function () {
return this.olMap.getView().getResolution();
}
})(ol, jQuery);
mapa = new Map({
target: 'map',
view: new ol.View({
center: ol.proj.transform([-51.1, -12.0], 'EPSG:4326', 'EPSG:3857'),
zoom: 6,
minZoom: 4,
maxZoom: 19
}),
});
Write your question in Portuguese, vc está no PT Stackoverflow.
– hugocsl