use Seminary location as default extent for Station locations (implements #134)

This commit is contained in:
oliver 2016-02-12 11:02:50 +01:00
parent a4f443d87a
commit 3fe164209b
2 changed files with 11 additions and 1 deletions

View file

@ -173,8 +173,13 @@
controls: ol.control.defaults(),
target: 'map',
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],
zoom: 0,
<?php endif ?>
maxZoom: 19
})
});

View file

@ -209,8 +209,13 @@
controls: ol.control.defaults(),
target: 'map',
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],
zoom: 0,
<?php endif ?>
maxZoom: 19
})
});
@ -228,7 +233,7 @@
drawSource.addFeature(
new ol.Feature({
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')
)
})
);