maps: fire combo:map-ready even if there is no GeoJSON URL (#24854)

This commit is contained in:
Frédéric Péters 2018-06-28 15:52:35 +02:00
parent 743cadaf89
commit 891f39be87
1 changed files with 11 additions and 7 deletions

View File

@ -131,15 +131,19 @@ $(function() {
attribution: map_attribution,
maxZoom: map_options.maxZoom
}).addTo(map);
map.add_geojson_layer(function(geo_json) {
var bounds = geo_json.getBounds();
if (bounds.isValid()) {
if (init_state == 'fit-markers') {
map.fitBounds(bounds);
if (geojson_url) {
map.add_geojson_layer(function(geo_json) {
var bounds = geo_json.getBounds();
if (bounds.isValid()) {
if (init_state == 'fit-markers') {
map.fitBounds(bounds);
}
}
}
$(cell).trigger('combo:map-ready');
});
} else {
$(cell).trigger('combo:map-ready');
});
}
};
$('div.cell.map').each(function() {
render_map(this);