umap-project 2.4.2__py3-none-any.whl → 2.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- umap/__init__.py +1 -1
- umap/locale/el/LC_MESSAGES/django.mo +0 -0
- umap/locale/eu/LC_MESSAGES/django.mo +0 -0
- umap/locale/hu/LC_MESSAGES/django.mo +0 -0
- umap/locale/hu/LC_MESSAGES/django.po +100 -50
- umap/static/umap/base.css +4 -1
- umap/static/umap/css/contextmenu.css +11 -0
- umap/static/umap/css/dialog.css +24 -3
- umap/static/umap/css/panel.css +4 -2
- umap/static/umap/css/slideshow.css +69 -0
- umap/static/umap/css/tableeditor.css +69 -0
- umap/static/umap/css/tooltip.css +3 -3
- umap/static/umap/img/16-white.svg +4 -0
- umap/static/umap/img/source/16-white.svg +5 -1
- umap/static/umap/js/components/alerts/alert.css +10 -10
- umap/static/umap/js/modules/autocomplete.js +23 -1
- umap/static/umap/js/modules/browser.js +14 -8
- umap/static/umap/js/modules/facets.js +40 -10
- umap/static/umap/js/modules/formatter.js +153 -0
- umap/static/umap/js/modules/global.js +10 -1
- umap/static/umap/js/modules/help.js +25 -25
- umap/static/umap/js/modules/importer.js +4 -4
- umap/static/umap/js/modules/importers/communesfr.js +3 -1
- umap/static/umap/js/modules/importers/datasets.js +8 -6
- umap/static/umap/js/modules/importers/geodatamine.js +10 -10
- umap/static/umap/js/modules/importers/overpass.js +18 -14
- umap/static/umap/js/modules/rules.js +13 -1
- umap/static/umap/js/modules/schema.js +16 -12
- umap/static/umap/js/{umap.share.js → modules/share.js} +60 -99
- umap/static/umap/js/modules/slideshow.js +141 -0
- umap/static/umap/js/modules/tableeditor.js +329 -0
- umap/static/umap/js/modules/ui/base.js +93 -0
- umap/static/umap/js/modules/ui/contextmenu.js +50 -0
- umap/static/umap/js/modules/ui/dialog.js +169 -31
- umap/static/umap/js/modules/ui/panel.js +6 -4
- umap/static/umap/js/modules/ui/tooltip.js +5 -75
- umap/static/umap/js/modules/utils.js +20 -0
- umap/static/umap/js/umap.controls.js +1 -1
- umap/static/umap/js/umap.features.js +22 -14
- umap/static/umap/js/umap.forms.js +157 -154
- umap/static/umap/js/umap.js +48 -34
- umap/static/umap/js/umap.layer.js +232 -164
- umap/static/umap/js/umap.permissions.js +1 -1
- umap/static/umap/js/umap.popup.js +1 -1
- umap/static/umap/locale/am_ET.js +22 -5
- umap/static/umap/locale/am_ET.json +19 -5
- umap/static/umap/locale/ar.js +22 -5
- umap/static/umap/locale/ar.json +19 -5
- umap/static/umap/locale/ast.js +22 -5
- umap/static/umap/locale/ast.json +19 -5
- umap/static/umap/locale/bg.js +22 -5
- umap/static/umap/locale/bg.json +19 -5
- umap/static/umap/locale/br.js +22 -5
- umap/static/umap/locale/br.json +19 -5
- umap/static/umap/locale/ca.js +56 -39
- umap/static/umap/locale/ca.json +53 -39
- umap/static/umap/locale/cs_CZ.js +22 -5
- umap/static/umap/locale/cs_CZ.json +19 -5
- umap/static/umap/locale/da.js +22 -5
- umap/static/umap/locale/da.json +19 -5
- umap/static/umap/locale/de.js +22 -5
- umap/static/umap/locale/de.json +19 -5
- umap/static/umap/locale/el.js +27 -10
- umap/static/umap/locale/el.json +19 -5
- umap/static/umap/locale/en.js +22 -6
- umap/static/umap/locale/en.json +19 -5
- umap/static/umap/locale/en_US.json +19 -5
- umap/static/umap/locale/es.js +22 -6
- umap/static/umap/locale/es.json +19 -5
- umap/static/umap/locale/et.js +22 -5
- umap/static/umap/locale/et.json +19 -5
- umap/static/umap/locale/eu.js +167 -150
- umap/static/umap/locale/eu.json +167 -150
- umap/static/umap/locale/fa_IR.js +22 -5
- umap/static/umap/locale/fa_IR.json +19 -5
- umap/static/umap/locale/fi.js +22 -5
- umap/static/umap/locale/fi.json +19 -5
- umap/static/umap/locale/fr.js +22 -6
- umap/static/umap/locale/fr.json +19 -5
- umap/static/umap/locale/gl.js +22 -5
- umap/static/umap/locale/gl.json +19 -5
- umap/static/umap/locale/he.js +22 -5
- umap/static/umap/locale/he.json +19 -5
- umap/static/umap/locale/hr.js +22 -5
- umap/static/umap/locale/hr.json +19 -5
- umap/static/umap/locale/hu.js +89 -72
- umap/static/umap/locale/hu.json +89 -75
- umap/static/umap/locale/id.js +22 -5
- umap/static/umap/locale/id.json +19 -5
- umap/static/umap/locale/is.js +22 -5
- umap/static/umap/locale/is.json +19 -5
- umap/static/umap/locale/it.js +22 -5
- umap/static/umap/locale/it.json +19 -5
- umap/static/umap/locale/ja.js +22 -5
- umap/static/umap/locale/ja.json +19 -5
- umap/static/umap/locale/ko.js +22 -5
- umap/static/umap/locale/ko.json +19 -5
- umap/static/umap/locale/lt.js +22 -5
- umap/static/umap/locale/lt.json +19 -5
- umap/static/umap/locale/ms.js +22 -5
- umap/static/umap/locale/ms.json +19 -5
- umap/static/umap/locale/nl.js +22 -5
- umap/static/umap/locale/nl.json +19 -5
- umap/static/umap/locale/no.js +22 -5
- umap/static/umap/locale/no.json +19 -5
- umap/static/umap/locale/pl.js +22 -5
- umap/static/umap/locale/pl.json +19 -5
- umap/static/umap/locale/pl_PL.json +19 -5
- umap/static/umap/locale/pt.js +22 -6
- umap/static/umap/locale/pt.json +21 -7
- umap/static/umap/locale/pt_BR.js +22 -5
- umap/static/umap/locale/pt_BR.json +19 -5
- umap/static/umap/locale/pt_PT.js +22 -5
- umap/static/umap/locale/pt_PT.json +19 -5
- umap/static/umap/locale/ro.js +22 -5
- umap/static/umap/locale/ro.json +19 -5
- umap/static/umap/locale/ru.js +22 -5
- umap/static/umap/locale/ru.json +19 -5
- umap/static/umap/locale/sk_SK.js +22 -5
- umap/static/umap/locale/sk_SK.json +19 -5
- umap/static/umap/locale/sl.js +22 -5
- umap/static/umap/locale/sl.json +19 -5
- umap/static/umap/locale/sr.js +22 -5
- umap/static/umap/locale/sr.json +19 -5
- umap/static/umap/locale/sv.js +22 -5
- umap/static/umap/locale/sv.json +19 -5
- umap/static/umap/locale/th_TH.js +22 -5
- umap/static/umap/locale/th_TH.json +19 -5
- umap/static/umap/locale/tr.js +22 -5
- umap/static/umap/locale/tr.json +19 -5
- umap/static/umap/locale/uk_UA.js +22 -5
- umap/static/umap/locale/uk_UA.json +19 -5
- umap/static/umap/locale/vi.js +22 -5
- umap/static/umap/locale/vi.json +19 -5
- umap/static/umap/locale/vi_VN.json +19 -5
- umap/static/umap/locale/zh.js +22 -5
- umap/static/umap/locale/zh.json +19 -5
- umap/static/umap/locale/zh_CN.json +19 -5
- umap/static/umap/locale/zh_TW.Big5.json +19 -5
- umap/static/umap/locale/zh_TW.js +22 -5
- umap/static/umap/locale/zh_TW.json +19 -5
- umap/static/umap/map.css +2 -145
- umap/static/umap/vars.css +5 -0
- umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +410 -428
- umap/static/umap/vendors/geojson-to-gpx/index.js +155 -0
- umap/static/umap/vendors/osmtogeojson/osmtogeojson.js +1 -2
- umap/static/umap/vendors/togeojson/togeojson.es.js +1109 -0
- umap/static/umap/vendors/togeojson/{togeojson.umd.js.map → togeojson.es.mjs.map} +1 -1
- umap/static/umap/vendors/tokml/tokml.es.js +895 -0
- umap/static/umap/vendors/tokml/tokml.es.mjs.map +1 -0
- umap/storage.py +6 -2
- umap/templates/umap/components/alerts/alert.html +3 -3
- umap/templates/umap/css.html +3 -0
- umap/templates/umap/js.html +0 -6
- umap/tests/fixtures/categorized_highway.geojson +1 -0
- umap/tests/fixtures/test_import_osm_relation.json +130 -0
- umap/tests/integration/conftest.py +8 -1
- umap/tests/integration/test_browser.py +3 -2
- umap/tests/integration/test_categorized_layer.py +141 -0
- umap/tests/integration/test_conditional_rules.py +21 -0
- umap/tests/integration/test_datalayer.py +9 -4
- umap/tests/integration/test_edit_datalayer.py +1 -0
- umap/tests/integration/test_edit_polygon.py +1 -1
- umap/tests/integration/test_export_map.py +2 -3
- umap/tests/integration/test_import.py +22 -0
- umap/tests/integration/test_tableeditor.py +158 -4
- umap/tests/integration/test_websocket_sync.py +2 -2
- {umap_project-2.4.2.dist-info → umap_project-2.5.1.dist-info}/METADATA +8 -8
- {umap_project-2.4.2.dist-info → umap_project-2.5.1.dist-info}/RECORD +172 -162
- umap/static/umap/js/umap.slideshow.js +0 -163
- umap/static/umap/js/umap.tableeditor.js +0 -118
- umap/static/umap/vendors/togeojson/togeojson.umd.js +0 -2
- umap/static/umap/vendors/togpx/togpx.js +0 -547
- umap/static/umap/vendors/tokml/tokml.js +0 -343
- {umap_project-2.4.2.dist-info → umap_project-2.5.1.dist-info}/WHEEL +0 -0
- {umap_project-2.4.2.dist-info → umap_project-2.5.1.dist-info}/entry_points.txt +0 -0
- {umap_project-2.4.2.dist-info → umap_project-2.5.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.tokml = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
|
|
2
|
-
var strxml = require('strxml'),
|
|
3
|
-
tag = strxml.tag,
|
|
4
|
-
encode = strxml.encode;
|
|
5
|
-
|
|
6
|
-
module.exports = function tokml(geojson, options) {
|
|
7
|
-
|
|
8
|
-
options = options || {
|
|
9
|
-
documentName: undefined,
|
|
10
|
-
documentDescription: undefined,
|
|
11
|
-
name: 'name',
|
|
12
|
-
description: 'description',
|
|
13
|
-
simplestyle: false,
|
|
14
|
-
timestamp: 'timestamp'
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
return '<?xml version="1.0" encoding="UTF-8"?>' +
|
|
18
|
-
tag('kml',
|
|
19
|
-
tag('Document',
|
|
20
|
-
documentName(options) +
|
|
21
|
-
documentDescription(options) +
|
|
22
|
-
root(geojson, options)
|
|
23
|
-
), [['xmlns', 'http://www.opengis.net/kml/2.2']]);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
function feature(options, styleHashesArray) {
|
|
27
|
-
return function(_) {
|
|
28
|
-
if (!_.properties || !geometry.valid(_.geometry)) return '';
|
|
29
|
-
var geometryString = geometry.any(_.geometry);
|
|
30
|
-
if (!geometryString) return '';
|
|
31
|
-
|
|
32
|
-
var styleDefinition = '',
|
|
33
|
-
styleReference = '';
|
|
34
|
-
if (options.simplestyle) {
|
|
35
|
-
var styleHash = hashStyle(_.properties);
|
|
36
|
-
if (styleHash) {
|
|
37
|
-
if (geometry.isPoint(_.geometry) && hasMarkerStyle(_.properties)) {
|
|
38
|
-
if (styleHashesArray.indexOf(styleHash) === -1) {
|
|
39
|
-
styleDefinition = markerStyle(_.properties, styleHash);
|
|
40
|
-
styleHashesArray.push(styleHash);
|
|
41
|
-
}
|
|
42
|
-
styleReference = tag('styleUrl', '#' + styleHash);
|
|
43
|
-
} else if ((geometry.isPolygon(_.geometry) || geometry.isLine(_.geometry)) &&
|
|
44
|
-
hasPolygonAndLineStyle(_.properties)) {
|
|
45
|
-
if (styleHashesArray.indexOf(styleHash) === -1) {
|
|
46
|
-
styleDefinition = polygonAndLineStyle(_.properties, styleHash);
|
|
47
|
-
styleHashesArray.push(styleHash);
|
|
48
|
-
}
|
|
49
|
-
styleReference = tag('styleUrl', '#' + styleHash);
|
|
50
|
-
}
|
|
51
|
-
// Note that style of GeometryCollection / MultiGeometry is not supported
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return styleDefinition + tag('Placemark',
|
|
56
|
-
name(_.properties, options) +
|
|
57
|
-
description(_.properties, options) +
|
|
58
|
-
extendeddata(_.properties) +
|
|
59
|
-
timestamp(_.properties, options) +
|
|
60
|
-
geometryString +
|
|
61
|
-
styleReference);
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function root(_, options) {
|
|
66
|
-
if (!_.type) return '';
|
|
67
|
-
var styleHashesArray = [];
|
|
68
|
-
|
|
69
|
-
switch (_.type) {
|
|
70
|
-
case 'FeatureCollection':
|
|
71
|
-
if (!_.features) return '';
|
|
72
|
-
return _.features.map(feature(options, styleHashesArray)).join('');
|
|
73
|
-
case 'Feature':
|
|
74
|
-
return feature(options, styleHashesArray)(_);
|
|
75
|
-
default:
|
|
76
|
-
return feature(options, styleHashesArray)({
|
|
77
|
-
type: 'Feature',
|
|
78
|
-
geometry: _,
|
|
79
|
-
properties: {}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function documentName(options) {
|
|
85
|
-
return (options.documentName !== undefined) ? tag('name', options.documentName) : '';
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function documentDescription(options) {
|
|
89
|
-
return (options.documentDescription !== undefined) ? tag('description', options.documentDescription) : '';
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function name(_, options) {
|
|
93
|
-
return _[options.name] ? tag('name', encode(_[options.name])) : '';
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function description(_, options) {
|
|
97
|
-
return _[options.description] ? tag('description', encode(_[options.description])) : '';
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function timestamp(_, options) {
|
|
101
|
-
return _[options.timestamp] ? tag('TimeStamp', tag('when', encode(_[options.timestamp]))) : '';
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// ## Geometry Types
|
|
105
|
-
//
|
|
106
|
-
// https://developers.google.com/kml/documentation/kmlreference#geometry
|
|
107
|
-
var geometry = {
|
|
108
|
-
Point: function(_) {
|
|
109
|
-
return tag('Point', tag('coordinates', _.coordinates.join(',')));
|
|
110
|
-
},
|
|
111
|
-
LineString: function(_) {
|
|
112
|
-
return tag('LineString', tag('coordinates', linearring(_.coordinates)));
|
|
113
|
-
},
|
|
114
|
-
Polygon: function(_) {
|
|
115
|
-
if (!_.coordinates.length) return '';
|
|
116
|
-
var outer = _.coordinates[0],
|
|
117
|
-
inner = _.coordinates.slice(1),
|
|
118
|
-
outerRing = tag('outerBoundaryIs',
|
|
119
|
-
tag('LinearRing', tag('coordinates', linearring(outer)))),
|
|
120
|
-
innerRings = inner.map(function(i) {
|
|
121
|
-
return tag('innerBoundaryIs',
|
|
122
|
-
tag('LinearRing', tag('coordinates', linearring(i))));
|
|
123
|
-
}).join('');
|
|
124
|
-
return tag('Polygon', outerRing + innerRings);
|
|
125
|
-
},
|
|
126
|
-
MultiPoint: function(_) {
|
|
127
|
-
if (!_.coordinates.length) return '';
|
|
128
|
-
return tag('MultiGeometry', _.coordinates.map(function(c) {
|
|
129
|
-
return geometry.Point({ coordinates: c });
|
|
130
|
-
}).join(''));
|
|
131
|
-
},
|
|
132
|
-
MultiPolygon: function(_) {
|
|
133
|
-
if (!_.coordinates.length) return '';
|
|
134
|
-
return tag('MultiGeometry', _.coordinates.map(function(c) {
|
|
135
|
-
return geometry.Polygon({ coordinates: c });
|
|
136
|
-
}).join(''));
|
|
137
|
-
},
|
|
138
|
-
MultiLineString: function(_) {
|
|
139
|
-
if (!_.coordinates.length) return '';
|
|
140
|
-
return tag('MultiGeometry', _.coordinates.map(function(c) {
|
|
141
|
-
return geometry.LineString({ coordinates: c });
|
|
142
|
-
}).join(''));
|
|
143
|
-
},
|
|
144
|
-
GeometryCollection: function(_) {
|
|
145
|
-
return tag('MultiGeometry',
|
|
146
|
-
_.geometries.map(geometry.any).join(''));
|
|
147
|
-
},
|
|
148
|
-
valid: function(_) {
|
|
149
|
-
return _ && _.type && (_.coordinates ||
|
|
150
|
-
_.type === 'GeometryCollection' && _.geometries && _.geometries.every(geometry.valid));
|
|
151
|
-
},
|
|
152
|
-
any: function(_) {
|
|
153
|
-
if (geometry[_.type]) {
|
|
154
|
-
return geometry[_.type](_);
|
|
155
|
-
} else {
|
|
156
|
-
return '';
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
isPoint: function(_) {
|
|
160
|
-
return _.type === 'Point' ||
|
|
161
|
-
_.type === 'MultiPoint';
|
|
162
|
-
},
|
|
163
|
-
isPolygon: function(_) {
|
|
164
|
-
return _.type === 'Polygon' ||
|
|
165
|
-
_.type === 'MultiPolygon';
|
|
166
|
-
},
|
|
167
|
-
isLine: function(_) {
|
|
168
|
-
return _.type === 'LineString' ||
|
|
169
|
-
_.type === 'MultiLineString';
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
function linearring(_) {
|
|
174
|
-
return _.map(function(cds) { return cds.join(','); }).join(' ');
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// ## Data
|
|
178
|
-
function extendeddata(_) {
|
|
179
|
-
return tag('ExtendedData', pairs(_).map(data).join(''));
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function data(_) {
|
|
183
|
-
return tag('Data', tag('value', encode(_[1])), [['name', encode(_[0])]]);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// ## Marker style
|
|
187
|
-
function hasMarkerStyle(_) {
|
|
188
|
-
return !!(_['marker-size'] || _['marker-symbol'] || _['marker-color']);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
function markerStyle(_, styleHash) {
|
|
192
|
-
return tag('Style',
|
|
193
|
-
tag('IconStyle',
|
|
194
|
-
tag('Icon',
|
|
195
|
-
tag('href', iconUrl(_)))) +
|
|
196
|
-
iconSize(_), [['id', styleHash]]);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function iconUrl(_) {
|
|
200
|
-
var size = _['marker-size'] || 'medium',
|
|
201
|
-
symbol = _['marker-symbol'] ? '-' + _['marker-symbol'] : '',
|
|
202
|
-
color = (_['marker-color'] || '7e7e7e').replace('#', '');
|
|
203
|
-
|
|
204
|
-
return 'https://api.tiles.mapbox.com/v3/marker/' + 'pin-' + size.charAt(0) +
|
|
205
|
-
symbol + '+' + color + '.png';
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function iconSize(_) {
|
|
209
|
-
return tag('hotSpot', '', [
|
|
210
|
-
['xunits', 'fraction'],
|
|
211
|
-
['yunits', 'fraction'],
|
|
212
|
-
['x', 0.5],
|
|
213
|
-
['y', 0.5]
|
|
214
|
-
]);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// ## Polygon and Line style
|
|
218
|
-
function hasPolygonAndLineStyle(_) {
|
|
219
|
-
for (var key in _) {
|
|
220
|
-
if ({
|
|
221
|
-
"stroke": true,
|
|
222
|
-
"stroke-opacity": true,
|
|
223
|
-
"stroke-width": true,
|
|
224
|
-
"fill": true,
|
|
225
|
-
"fill-opacity": true
|
|
226
|
-
}[key]) return true;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function polygonAndLineStyle(_, styleHash) {
|
|
231
|
-
var lineStyle = tag('LineStyle', [
|
|
232
|
-
tag('color', hexToKmlColor(_['stroke'], _['stroke-opacity']) || 'ff555555') +
|
|
233
|
-
tag('width', _['stroke-width'] === undefined ? 2 : _['stroke-width'])
|
|
234
|
-
]);
|
|
235
|
-
|
|
236
|
-
var polyStyle = '';
|
|
237
|
-
|
|
238
|
-
if (_['fill'] || _['fill-opacity']) {
|
|
239
|
-
polyStyle = tag('PolyStyle', [
|
|
240
|
-
tag('color', hexToKmlColor(_['fill'], _['fill-opacity']) || '88555555')
|
|
241
|
-
]);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
return tag('Style', lineStyle + polyStyle, [['id', styleHash]]);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
// ## Style helpers
|
|
248
|
-
function hashStyle(_) {
|
|
249
|
-
var hash = '';
|
|
250
|
-
|
|
251
|
-
if (_['marker-symbol']) hash = hash + 'ms' + _['marker-symbol'];
|
|
252
|
-
if (_['marker-color']) hash = hash + 'mc' + _['marker-color'].replace('#', '');
|
|
253
|
-
if (_['marker-size']) hash = hash + 'ms' + _['marker-size'];
|
|
254
|
-
if (_['stroke']) hash = hash + 's' + _['stroke'].replace('#', '');
|
|
255
|
-
if (_['stroke-width']) hash = hash + 'sw' + _['stroke-width'].toString().replace('.', '');
|
|
256
|
-
if (_['stroke-opacity']) hash = hash + 'mo' + _['stroke-opacity'].toString().replace('.', '');
|
|
257
|
-
if (_['fill']) hash = hash + 'f' + _['fill'].replace('#', '');
|
|
258
|
-
if (_['fill-opacity']) hash = hash + 'fo' + _['fill-opacity'].toString().replace('.', '');
|
|
259
|
-
|
|
260
|
-
return hash;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function hexToKmlColor(hexColor, opacity) {
|
|
264
|
-
if (typeof hexColor !== 'string') return '';
|
|
265
|
-
|
|
266
|
-
hexColor = hexColor.replace('#', '').toLowerCase();
|
|
267
|
-
|
|
268
|
-
if (hexColor.length === 3) {
|
|
269
|
-
hexColor = hexColor[0] + hexColor[0] +
|
|
270
|
-
hexColor[1] + hexColor[1] +
|
|
271
|
-
hexColor[2] + hexColor[2];
|
|
272
|
-
} else if (hexColor.length !== 6) {
|
|
273
|
-
return '';
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
var r = hexColor[0] + hexColor[1];
|
|
277
|
-
var g = hexColor[2] + hexColor[3];
|
|
278
|
-
var b = hexColor[4] + hexColor[5];
|
|
279
|
-
|
|
280
|
-
var o = 'ff';
|
|
281
|
-
if (typeof opacity === 'number' && opacity >= 0.0 && opacity <= 1.0) {
|
|
282
|
-
o = (opacity * 255).toString(16);
|
|
283
|
-
if (o.indexOf('.') > -1) o = o.substr(0, o.indexOf('.'));
|
|
284
|
-
if (o.length < 2) o = '0' + o;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return o + b + g + r;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// ## General helpers
|
|
291
|
-
function pairs(_) {
|
|
292
|
-
var o = [];
|
|
293
|
-
for (var i in _) o.push([i, _[i]]);
|
|
294
|
-
return o;
|
|
295
|
-
}
|
|
296
|
-
},{"strxml":2}],2:[function(require,module,exports){
|
|
297
|
-
module.exports.attr = attr;
|
|
298
|
-
module.exports.tagClose = tagClose;
|
|
299
|
-
module.exports.tag = tag;
|
|
300
|
-
module.exports.encode = encode;
|
|
301
|
-
|
|
302
|
-
/**
|
|
303
|
-
* @param {array} _ an array of attributes
|
|
304
|
-
* @returns {string}
|
|
305
|
-
*/
|
|
306
|
-
function attr(_) {
|
|
307
|
-
return (_ && _.length) ? (' ' + _.map(function(a) {
|
|
308
|
-
return a[0] + '="' + a[1] + '"';
|
|
309
|
-
}).join(' ')) : '';
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* @param {string} el element name
|
|
314
|
-
* @param {array} attributes array of pairs
|
|
315
|
-
* @returns {string}
|
|
316
|
-
*/
|
|
317
|
-
function tagClose(el, attributes) {
|
|
318
|
-
return '<' + el + attr(attributes) + '/>';
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* @param {string} el element name
|
|
323
|
-
* @param {string} contents innerXML
|
|
324
|
-
* @param {array} attributes array of pairs
|
|
325
|
-
* @returns {string}
|
|
326
|
-
*/
|
|
327
|
-
function tag(el, contents, attributes) {
|
|
328
|
-
return '<' + el + attr(attributes) + '>' + contents + '</' + el + '>';
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* @param {string} _ a string of attribute
|
|
333
|
-
* @returns {string}
|
|
334
|
-
*/
|
|
335
|
-
function encode(_) {
|
|
336
|
-
return (_ === null ? '' : _.toString()).replace(/&/g, '&')
|
|
337
|
-
.replace(/</g, '<')
|
|
338
|
-
.replace(/>/g, '>')
|
|
339
|
-
.replace(/"/g, '"');
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
},{}]},{},[1])(1)
|
|
343
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|