[js] use L.version to build cdn url rather than harcoding version number (closes #4725752)

authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
changeset965c86e0d322
branchdefault
phasedraft
hiddenyes
parent revision#d20806155fbf Added tag cubicweb-leaflet-version-0.2.1, cubicweb-leaflet-debian-version-0.2.1-1, cubicweb-leaflet-centos-version-0.2.1-1 for changeset 7e8818163d47
child revision#149e7bb8dd3a sync cdn and shipped version of leaflet.js (closes #4725754)
files modified by this revision
data/cubes.leaflet.js
# HG changeset patch
# User Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
# Date 1417802292 -3600
# Fri Dec 05 18:58:12 2014 +0100
# Node ID 965c86e0d322cdb7f81e5c56c1b45a48eb105ce1
# Parent d20806155fbf57953cddaaff8e91f892e246a98f
[js] use L.version to build cdn url rather than harcoding version number (closes #4725752)

diff --git a/data/cubes.leaflet.js b/data/cubes.leaflet.js
@@ -14,11 +14,11 @@
1       * @param datasource either a list or leaflet markers or an url deferencing json markers
2       * @param settings leaflet settings
3       **/
4      renderLeafLetMap: function(datasource, settings) {
5          function _renderMarkers(markers, settings) {
6 -            L.Icon.Default.imagePath = 'http://cdn.leafletjs.com/leaflet-0.4.5/images';
7 +            L.Icon.Default.imagePath = 'http://cdn.leafletjs.com/leaflet-' + L.version + '/images';
8              // center on first marker if no center is specified
9              if (markers.length > 0) {
10                  var center = settings.center || [markers[0].latitude, markers[0].longitude];
11              } else {
12                  var center = [0, 0];