Subversion Repositories eFlore/Applications.cel

Rev

Rev 3857 | Rev 3869 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3857 Rev 3864
Line 11... Line 11...
11
    ],
11
    ],
12
    osm: [
12
    osm: [
13
        'https://osm.tela-botanica.org/tuiles/osmfr/{z}/{x}/{y}.png',
13
        'https://osm.tela-botanica.org/tuiles/osmfr/{z}/{x}/{y}.png',
14
        {
14
        {
15
            attribution: 'Data © <a href="http://osm.org/copyright">OpenStreetMap</a>',
15
            attribution: 'Data © <a href="http://osm.org/copyright">OpenStreetMap</a>',
16
             maxZoom: 18
16
            maxZoom: 18
17
        }
17
        }
18
    ]
18
    ]
19
};
19
};
20
const defaultPosition = {
20
const defaultPosition = {
21
    lat: 47.0504,
21
    lat: 47.0504,
Line 151... Line 151...
151
    this.longitudeEl = document.getElementById('longitude' + formSuffix);
151
    this.longitudeEl = document.getElementById('longitude' + formSuffix);
152
};
152
};
Line 153... Line 153...
153
 
153
 
154
Geoloc.prototype.initEvts = function() {
154
Geoloc.prototype.initEvts = function() {
155
    this.initMap();
-
 
156
    this.handleCoordinates();
155
    this.initMap();
157
    this.onCoordinates();
156
    this.initMapCoordinates();
158
    this.initSearchLocality();
157
    this.initSearchLocality();
Line 159... Line 158...
159
};
158
};
160
 
159
 
Line 191... Line 190...
191
    this.map.on(L.Draw.Event.DELETED, evt => {
190
    this.map.on(L.Draw.Event.DELETED, evt => {
192
        this.reSetDrawControl();
191
        this.reSetDrawControl();
193
    });
192
    });
194
};
193
};
Line -... Line 194...
-
 
194
 
-
 
195
Geoloc.prototype.initMapCoordinates = function() {
-
 
196
    if (!!this.latitudeEl.value && !!this.longitudeEl.value) {
-
 
197
        this.setMapCoordinates({
-
 
198
            'lat': this.latitudeEl.value,
-
 
199
            'lng': this.longitudeEl.value
-
 
200
        });
-
 
201
    }
-
 
202
    this.onCoordinates();
-
 
203
};
Line 195... Line 204...
195
 
204
 
196
 
205
 
197
Geoloc.prototype.reSetDrawControl = function() {
206
Geoloc.prototype.reSetDrawControl = function() {
198
    this.map.removeLayer(this.layer);
207
    this.map.removeLayer(this.layer);