Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 3849 Rev 3862
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();
Line 195... Line 203...
195
 
203
};
196
 
204
 
197
Geoloc.prototype.reSetDrawControl = function() {
205
Geoloc.prototype.reSetDrawControl = function() {
198
    this.map.removeLayer(this.layer);
206
    this.map.removeLayer(this.layer);
Line 533... Line 541...
533
    // reset map
541
    // reset map
534
    this.map = L.DomUtil.get(this.mapIdAttr);
542
    this.map = L.DomUtil.get(this.mapIdAttr);
535
    if (this.map != null) {
543
    if (this.map != null) {
536
        this.map._leaflet_id = null;
544
        this.map._leaflet_id = null;
537
    }
545
    }
538
};
-
 
539
546
};
-
 
547