I have a modal with OpenLayers map directive, which works fine except in modal window. I tried loading with controller but nothing.
This is directive i created, as you can see it's simple as possible:
.directive('olMap', function() {
return {
restrict: 'E',
replace: true,
template: '<div id="map" class="map"></div>',
link: function postLink(scope, element, attrs) {
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'sat'})
})
],
view: new ol.View({
center: ol.proj.transform([37.41, 8.82], 'EPSG:4326', 'EPSG:3857'),
zoom: 4
})
});
}
}
});
Why is that?