[BUG FIX] geocode position [0;0] => ocean

This commit is contained in:
Xavier J 2015-12-10 14:33:09 +01:00
parent 527026a6b7
commit f42f3820e9

View file

@ -1,12 +1,15 @@
var LON = '2.428462';
var LAT = '46.538192';
function initCarto() {
OSM = L.tileLayer("http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", {
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
});
var LON = '2.428462';
var LAT = '46.538192';
position = get_position() || default_position();
position = get_position() || {lon: LON, lat: LAT, zoom: 13};
if (position.lon == "0" && position.lat == "0")
position = default_position();
if (typeof position.zoom == 'undefined')
position.zoom = 13;
@ -36,6 +39,10 @@ function initCarto() {
display_qp(JSON.parse($("#quartier_prioritaires").val()));
}
function default_position (){
return {lon: LON, lat: LAT, zoom: 13}
}
function add_event_freeDraw() {
freeDraw.on('markers', function (e) {
$("#json_latlngs").val(JSON.stringify(e.latLngs));