use Seminary location as default extent for Station locations (implements #134)
This commit is contained in:
parent
a4f443d87a
commit
3fe164209b
2 changed files with 11 additions and 1 deletions
|
|
@ -173,8 +173,13 @@
|
||||||
controls: ol.control.defaults(),
|
controls: ol.control.defaults(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
<?php if(!is_null($seminary['latitude']) && !is_null($seminary['longitude'])) : ?>
|
||||||
|
center: ol.proj.transform([<?=$seminary['longitude']?>, <?=$seminary['latitude']?>], 'EPSG:4326', 'EPSG:3857'),
|
||||||
|
zoom: 15,
|
||||||
|
<?php else : ?>
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 0,
|
zoom: 0,
|
||||||
|
<?php endif ?>
|
||||||
maxZoom: 19
|
maxZoom: 19
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -209,8 +209,13 @@
|
||||||
controls: ol.control.defaults(),
|
controls: ol.control.defaults(),
|
||||||
target: 'map',
|
target: 'map',
|
||||||
view: new ol.View({
|
view: new ol.View({
|
||||||
|
<?php if(!is_null($latitude) && !is_null($longitude)) : ?>
|
||||||
|
center: ol.proj.transform([<?=$longitude?>, <?=$latitude?>], 'EPSG:4326', 'EPSG:3857'),
|
||||||
|
zoom: 17,
|
||||||
|
<?php else : ?>
|
||||||
center: [0, 0],
|
center: [0, 0],
|
||||||
zoom: 0,
|
zoom: 0,
|
||||||
|
<?php endif ?>
|
||||||
maxZoom: 19
|
maxZoom: 19
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
@ -228,7 +233,7 @@
|
||||||
drawSource.addFeature(
|
drawSource.addFeature(
|
||||||
new ol.Feature({
|
new ol.Feature({
|
||||||
geometry: new ol.geom.Point(
|
geometry: new ol.geom.Point(
|
||||||
ol.proj.transform([longitude, latitude], 'EPSG:4326', 'EPSG:3857')
|
ol.proj.transform([parseFloat(longitude), parseFloat(latitude)], 'EPSG:4326', 'EPSG:3857')
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue