├── .gitignore
├── Gruntfile.js
├── LICENSE
├── README.md
├── debug
├── css
│ ├── debug.css
│ └── performance.css
├── index.html
├── kothic-include.js
├── styles
│ ├── mapnik.js
│ ├── mapnik.png
│ ├── osmosnimki.js
│ ├── osmosnimki.png
│ └── surface.js
├── test-tile.json
└── tile.html
├── dist
└── kothic-leaflet.js
├── package.json
└── src
├── kothic.js
├── renderer
├── line.js
├── path.js
├── polygon.js
├── shields.js
├── text.js
└── texticons.js
├── style
├── mapcss.js
└── style.js
└── utils
├── collisions.js
├── geom.js
└── rbush.js
/.gitignore:
--------------------------------------------------------------------------------
1 | dist/kothic*.js
2 | node_modules
3 | .idea
4 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | /*global module:false*/
2 | module.exports = function (grunt) {
3 | 'use strict';
4 |
5 | grunt.initConfig({
6 | jshint: {
7 | options: {
8 | strict: false,
9 |
10 | bitwise: false,
11 | curly: false,
12 | eqeqeq: true,
13 | immed: true,
14 | latedef: true,
15 | newcap: true,
16 | noarg: true,
17 | noempty: true,
18 | nonew: true,
19 | sub: true,
20 | undef: false,
21 | unused: true,
22 |
23 | globals: {
24 | MapCSS: true,
25 | L: true,
26 | Kothic: true,
27 | console: true,
28 | rbush: true
29 | },
30 |
31 | // camelcase: true,
32 | trailing: true,
33 | indent: 4,
34 | // quotmark: 'single',
35 | // maxlen: 120,
36 |
37 | // force breaking complex functions into smaller ones for readability
38 | // maxstatements: 10,
39 | // maxcomplexity: 5,
40 |
41 | browser: true
42 | },
43 | all: {
44 | src: ['Gruntfile.js', 'src/**/*.js', 'dist/kothic-leaflet.js', '!src/utils/rbush.js']
45 | }
46 | },
47 |
48 | concat: {
49 | options: {
50 | separator: ';'
51 | },
52 | dist: {
53 | src: ['src/**/*.js'],
54 | dest: 'dist/kothic.js'
55 | }
56 | },
57 |
58 | uglify: {
59 | options: {
60 | banner: '/*\n (c) 2011-2019, Darafei Praliaskouski, Vladimir Agafonkin, Maksim Gurtovenko, Stephan Brandt\n' +
61 | ' Kothic JS is a full-featured JavaScript map rendering engine using HTML5 Canvas.\n' +
62 | ' Built on <%= grunt.template.today("dd-mm-yyyy") %> |' +
63 | ' https://github.com/kothic/kothic-js\n*/\n'
64 | },
65 | dist: {
66 | files: {
67 | 'dist/kothic.min.js': ['<%= concat.dist.dest %>']
68 | }
69 | }
70 | },
71 | });
72 |
73 | grunt.loadNpmTasks('grunt-contrib-jshint');
74 | grunt.loadNpmTasks('grunt-contrib-concat');
75 | grunt.loadNpmTasks('grunt-contrib-uglify');
76 |
77 | grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
78 | };
79 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2013, Darafei Praliaskouski, Vladimir Agafonkin, Maksim Gurtovenko
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without modification, are
5 | permitted provided that the following conditions are met:
6 |
7 | 1. Redistributions of source code must retain the above copyright notice, this list of
8 | conditions and the following disclaimer.
9 |
10 | 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 | of conditions and the following disclaimer in the documentation and/or other materials
12 | provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
15 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
17 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
21 | TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | **Kothic JS** is a full-featured JavaScript map rendering engine using HTML5 Canvas.
2 | It was initially developed as a JavaScript port of [Kothic](http://wiki.openstreetmap.org/wiki/Kothic) rendering engine written in Python.
3 |
4 | Check out the demo: http://kothic.org/
5 |
6 | ### Features
7 |
8 | * Rendering [OpenStreetMap](http://openstreetmap.org) data visually on par with [Mapnik](http://mapnik.org)
9 | * [MapCSS](http://wiki.openstreetmap.org/wiki/MapCSS/0.2) support (see [How to Prepare a Map Style](https://github.com/kothic/kothic-js/wiki/How-to-prepare-map-style))
10 | * rendering from lightweight GeoJSON-like tiles (see [Tiles Format](https://github.com/kothic/kothic-js/wiki/Tiles-format))
11 | * easy integration with [Leaflet](http://leaflet.cloudmade.com) (interactive maps library)
12 |
13 | ### Building Kothic
14 |
15 | Install Node.js, then run:
16 |
17 | ```
18 | npm install
19 | npm install -g grunt-cli
20 | grunt
21 | ```
22 |
23 | Minified Kothic source will be generated in the `dist` folder.
24 |
25 | ### Basic usage
26 |
27 | Include `kothic.js` from the `dist` folder on your page. Now you can call:
28 |
29 | ```javascript
30 | Kothic.render(
31 | canvas, // canvas element (or its id) to render on
32 | data, // JSON data to render
33 | zoom, // zoom level
34 | {
35 | onRenderComplete: callback, // (optional) callback to call when rendering is done
36 | styles: ['osmosnimki-maps', 'surface'], // (optional) only specified styles will be rendered, if any
37 | locales: ['be', 'ru', 'en'] // (optional) map languages, see below
38 | });
39 | ```
40 |
41 | `locales` Kothic-JS supports map localization based on name:*lang* tags. Renderer will check all mentioned languages in order of persence. If object doesn't have localized name, *name* tag will be used.
42 |
43 | ### Contributing to Kothic JS
44 |
45 | Kothic JS is licensed under a BSD license, and we'll be glad to accept your contributions!
46 |
47 | #### Core contributors:
48 |
49 | * Darafei Praliaskouski ([@Komzpa](https://github.com/Komzpa))
50 | * Vladimir Agafonkin ([@mourner](https://github.com/mourner), creator of [Leaflet](http://leafletjs.com))
51 | * Maksim Gurtovenko ([@Miroff](https://github.com/Miroff))
52 |
53 | * Leaflet 1.x compatibility, Stephan Brandt ([@braandl](https://github.com/braandl))
--------------------------------------------------------------------------------
/debug/css/debug.css:
--------------------------------------------------------------------------------
1 | body {
2 | padding: 0;
3 | margin: 0;
4 | }
5 | html, body, #map {
6 | height: 100%;
7 | }
8 | #debug {
9 | position: absolute;
10 | top: 0;
11 | right: 0;
12 | background: rgba(255,255,255,0.7);
13 | border: 1px solid #ddd;
14 | padding: 10px;
15 | z-index: 10000;
16 | font: 12px/1.4 Verdana, sans-serif;
17 | width: 170px;
18 | }
19 | #trace {
20 | margin-top: 10px;
21 | font: 10px/1 Verdana, sans-serif;
22 | }
23 | #trace table {
24 | margin-top: 3px;
25 | }
26 | #mapnik {
27 | margin-bottom: 10px;
28 | }
29 | table {
30 | border-collapse: collapse;
31 | }
32 | table td {
33 | padding-right: 10px;
34 | }
35 |
36 | #trace .tileIndex {
37 | font-weight: bold;
38 | }
39 |
40 | td.time {
41 | text-align: right;
42 | }
43 |
--------------------------------------------------------------------------------
/debug/css/performance.css:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/debug/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Kothic debug page
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
OpenStreetMap data rendered on the browser using Kothic JS
36 |
41 |
Surface overlay
42 |
Rendering...
43 |
44 |
156 |
157 |
158 |
--------------------------------------------------------------------------------
/debug/kothic-include.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | var scripts = [
3 | 'kothic.js',
4 | 'renderer/path.js',
5 | 'renderer/line.js',
6 | 'renderer/polygon.js',
7 | 'renderer/shields.js',
8 | 'renderer/texticons.js',
9 | 'renderer/text.js',
10 | 'style/mapcss.js',
11 | 'style/style.js',
12 | 'utils/collisions.js',
13 | 'utils/geom.js',
14 | 'utils/rbush.js'
15 | ];
16 |
17 | function getSrcUrl() {
18 | var scripts = document.getElementsByTagName('script');
19 | for (var i = 0; i < scripts.length; i++) {
20 | var src = scripts[i].src;
21 | if (src) {
22 | var res = src.match(/^(.*)kothic-include\.js$/);
23 | if (res) {
24 | return res[1] + '../src/';
25 | }
26 | }
27 | }
28 |
29 | return "";
30 | }
31 |
32 | var path = getSrcUrl();
33 | for (var i = 0; i < scripts.length; i++) {
34 | document.writeln("");
35 | }
36 | })();
37 |
--------------------------------------------------------------------------------
/debug/styles/mapnik.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kothic/kothic-js/4edc827f5f59b680ce2c6936d98d8b8283b6620e/debug/styles/mapnik.png
--------------------------------------------------------------------------------
/debug/styles/osmosnimki.js:
--------------------------------------------------------------------------------
1 |
2 | (function (MapCSS) {
3 | 'use strict';
4 |
5 | function restyle(style, tags, zoom, type, selector) {
6 | var s_default = {}, s_centerline = {}, s_ticks = {}, s_label = {};
7 |
8 | if ((selector === 'canvas')) {
9 | s_default['fill-color'] = '#C4D4F5';
10 | }
11 |
12 | if (((selector === 'area' && tags['natural'] === 'coastline'))) {
13 | s_default['fill-color'] = '#fcf8e4';
14 | s_default['-x-mapnik-layer'] = 'bottom';
15 | }
16 |
17 | if (((selector === 'area' && tags['natural'] === 'glacier') && zoom >= 3)) {
18 | s_default['fill-color'] = '#fcfeff';
19 | s_default['fill-image'] = 'glacier.png';
20 | }
21 |
22 | if (((selector === 'area' && tags['place'] === 'city') && zoom >= 10) || ((selector === 'area' && tags['place'] === 'town') && zoom >= 10)) {
23 | s_default['fill-color'] = '#FAF7F7';
24 | s_default['fill-opacity'] = 0.6;
25 | s_default['z-index'] = 1;
26 | }
27 |
28 | if (((selector === 'area' && tags['place'] === 'hamlet') && zoom >= 10) || ((selector === 'area' && tags['place'] === 'village') && zoom >= 10) || ((selector === 'area' && tags['place'] === 'locality') && zoom >= 10)) {
29 | s_default['fill-color'] = '#f3eceb';
30 | s_default['fill-opacity'] = 0.6;
31 | s_default['z-index'] = 1;
32 | }
33 |
34 | if (((selector === 'area' && tags['landuse'] === 'residential') && zoom >= 10) || ((selector === 'area' && tags['residential'] === 'urban') && zoom >= 10)) {
35 | s_default['fill-color'] = '#F7EFEB';
36 | s_default['z-index'] = 2;
37 | }
38 |
39 | if (((selector === 'area' && tags['residential'] === 'rural') && zoom >= 10)) {
40 | s_default['fill-color'] = '#f4d7c7';
41 | s_default['z-index'] = 2;
42 | }
43 |
44 | if (((selector === 'area' && tags['landuse'] === 'residential') && zoom >= 16)) {
45 | s_default['width'] = 0.3;
46 | s_default['color'] = '#cb8904';
47 | s_default['z-index'] = 2;
48 | }
49 |
50 | if (((selector === 'area' && tags['landuse'] === 'allotments') && zoom >= 10) || ((selector === 'area' && tags['leisure'] === 'garden') && zoom >= 10 && zoom <= 15) || ((selector === 'area' && tags['landuse'] === 'orchard') && zoom >= 10 && zoom <= 15)) {
51 | s_default['fill-color'] = '#edf2c1';
52 | s_default['z-index'] = 3;
53 | }
54 |
55 | if (((selector === 'area' && tags['leisure'] === 'park') && zoom >= 10)) {
56 | s_default['fill-color'] = '#c4e9a4';
57 | s_default['z-index'] = 3;
58 | s_default['fill-image'] = 'parks2.png';
59 | }
60 |
61 | if (((selector === 'area' && tags['leisure'] === 'garden') && zoom >= 16) || ((selector === 'area' && tags['landuse'] === 'orchard') && zoom >= 16)) {
62 | s_default['fill-image'] = 'sady10.png';
63 | s_default['z-index'] = 3;
64 | }
65 |
66 | if (((selector === 'area' && tags['natural'] === 'scrub') && zoom >= 12)) {
67 | s_default['fill-color'] = '#e5f5dc';
68 | s_default['fill-image'] = 'kust1.png';
69 | s_default['z-index'] = 3;
70 | }
71 |
72 | if (((selector === 'area' && tags['natural'] === 'heath') && zoom >= 12)) {
73 | s_default['fill-color'] = '#ecffe5';
74 | s_default['z-index'] = 3;
75 | }
76 |
77 | if (((selector === 'area' && tags['landuse'] === 'industrial') && zoom >= 10) || ((selector === 'area' && tags['landuse'] === 'military') && zoom >= 10)) {
78 | s_default['fill-color'] = '#ddd8da';
79 | s_default['z-index'] = 3;
80 | }
81 |
82 | if (((selector === 'area' && tags['amenity'] === 'parking') && zoom >= 15)) {
83 | s_default['fill-color'] = '#ecedf4';
84 | s_default['z-index'] = 3;
85 | }
86 |
87 | if (((selector === 'area' && tags['natural'] === 'desert') && zoom >= 4)) {
88 | s_default['fill-image'] = 'desert22.png';
89 | }
90 |
91 | if (((selector === 'area' && tags['natural'] === 'forest') && zoom >= 4) || ((selector === 'area' && tags['natural'] === 'wood') && zoom >= 4) || ((selector === 'area' && tags['landuse'] === 'forest') && zoom >= 4) || ((selector === 'area' && tags['landuse'] === 'wood') && zoom >= 4)) {
92 | s_default['fill-color'] = '#d6f4c6';
93 | s_default['z-index'] = 3;
94 | }
95 |
96 | if (((selector === 'area' && tags['landuse'] === 'garages') && zoom >= 10)) {
97 | s_default['fill-color'] = '#ddd8da';
98 | s_default['z-index'] = 3;
99 | }
100 |
101 | if (((selector === 'area' && tags['natural'] === 'forest') && zoom >= 10) || ((selector === 'area' && tags['natural'] === 'wood') && zoom >= 10) || ((selector === 'area' && tags['landuse'] === 'forest') && zoom >= 10) || ((selector === 'area' && tags['landuse'] === 'wood') && zoom >= 10)) {
102 | s_default['text'] = MapCSS.e_localize(tags, 'name');
103 | s_default['text-offset'] = 0;
104 | s_default['font-size'] = '10';
105 | s_default['font-family'] = 'DejaVu Serif Italic';
106 | s_default['text-color'] = 'green';
107 | s_default['text-allow-overlap'] = 'false';
108 | s_default['text-halo-radius'] = 1;
109 | s_default['text-halo-color'] = '#ffffff';
110 | s_default['-x-mapnik-min-distance'] = '0 ';
111 | }
112 |
113 | if (((selector === 'area' && tags['landuse'] === 'grass') && zoom >= 12) || ((selector === 'area' && tags['natural'] === 'grass') && zoom >= 12) || ((selector === 'area' && tags['natural'] === 'meadow') && zoom >= 12) || ((selector === 'area' && tags['landuse'] === 'meadow') && zoom >= 12) || ((selector === 'area' && tags['landuse'] === 'recreation_ground') && zoom >= 12)) {
114 | s_default['fill-color'] = '#f4ffe5';
115 | s_default['z-index'] = 4;
116 | }
117 |
118 | if (((selector === 'area' && tags['natural'] === 'wetland') && zoom >= 10)) {
119 | s_default['fill-image'] = 'swamp_world2.png';
120 | s_default['z-index'] = 4;
121 | }
122 |
123 | if (((selector === 'area' && tags['landuse'] === 'farmland') && zoom >= 10) || ((selector === 'area' && tags['landuse'] === 'farm') && zoom >= 10) || ((selector === 'area' && tags['landuse'] === 'field') && zoom >= 10)) {
124 | s_default['fill-color'] = '#fff5c4';
125 | s_default['z-index'] = 5;
126 | }
127 |
128 | if (((selector === 'area' && tags['place'] === 'city') && zoom >= 6 && zoom <= 9) || ((selector === 'area' && tags['place'] === 'town') && zoom >= 6 && zoom <= 9)) {
129 | s_default['fill-color'] = '#ffe1d0';
130 | s_default['fill-opacity'] = 0.6;
131 | s_default['z-index'] = 5;
132 | }
133 |
134 | if (((selector === 'area' && tags['landuse'] === 'cemetery') && zoom >= 10)) {
135 | s_default['fill-color'] = '#e5f5dc';
136 | s_default['z-index'] = 5;
137 | s_default['fill-image'] = 'cemetry7_2.png';
138 | }
139 |
140 | if (((selector === 'area' && tags['aeroway'] === 'aerodrome') && zoom >= 13)) {
141 | s_default['color'] = '#008ac6';
142 | s_default['width'] = 0.8;
143 | s_default['z-index'] = 5;
144 | s_default['fill-image'] = 'bull2.png';
145 | }
146 |
147 | if (((selector === 'area' && tags['leisure'] === 'stadium') && zoom >= 12) || ((selector === 'area' && tags['leisure'] === 'pitch') && zoom >= 12)) {
148 | s_default['fill-color'] = '#e3deb1';
149 | s_default['z-index'] = 5;
150 | }
151 |
152 | if (((type === 'way' && tags['waterway'] === 'river') && zoom >= 7 && zoom <= 10)) {
153 | s_default['color'] = '#C4D4F5';
154 | s_default['width'] = 0.6;
155 | s_default['z-index'] = 9;
156 | }
157 |
158 | if (((type === 'way' && tags['waterway'] === 'stream') && zoom >= 9 && zoom <= 10)) {
159 | s_default['color'] = '#C4D4F5';
160 | s_default['width'] = 0.3;
161 | s_default['z-index'] = 9;
162 | }
163 |
164 | if (((type === 'way' && tags['waterway'] === 'river') && zoom >= 10 && zoom <= 14)) {
165 | s_default['color'] = '#C4D4F5';
166 | s_default['width'] = 0.7;
167 | s_default['z-index'] = 9;
168 | }
169 |
170 | if (((type === 'way' && tags['waterway'] === 'river') && zoom >= 15)) {
171 | s_default['color'] = '#C4D4F5';
172 | s_default['width'] = 0.9;
173 | s_default['z-index'] = 9;
174 | }
175 |
176 | if (((type === 'way' && tags['waterway'] === 'stream') && zoom >= 10)) {
177 | s_default['color'] = '#C4D4F5';
178 | s_default['width'] = 0.5;
179 | s_default['z-index'] = 9;
180 | }
181 |
182 | if (((type === 'way' && tags['waterway'] === 'canal') && zoom >= 10)) {
183 | s_default['color'] = '#abc4f5';
184 | s_default['width'] = 0.6;
185 | s_default['z-index'] = 9;
186 | }
187 |
188 | if (((selector === 'area' && tags['waterway'] === 'riverbank') && zoom >= 5) || ((selector === 'area' && tags['natural'] === 'water') && zoom >= 5) || ((selector === 'area' && tags['landuse'] === 'reservoir') && zoom >= 10)) {
189 | s_default['fill-color'] = '#C4D4F5';
190 | s_default['color'] = '#C4D4F5';
191 | s_default['width'] = 0.1;
192 | s_default['z-index'] = 9;
193 | }
194 |
195 | if (((selector === 'area' && tags['natural'] === 'water') && zoom >= 9)) {
196 | s_default['text'] = MapCSS.e_localize(tags, 'name');
197 | s_default['text-offset'] = 1;
198 | s_default['font-size'] = '10';
199 | s_default['font-family'] = 'DejaVu Serif Italic';
200 | s_default['text-color'] = '#285fd1';
201 | s_default['text-allow-overlap'] = 'false';
202 | s_default['text-halo-radius'] = 1;
203 | s_default['text-halo-color'] = '#ffffff';
204 | }
205 |
206 | if (((type === 'way' && tags['highway'] === 'construction') && zoom >= 15 && zoom <= 16)) {
207 | s_default['text'] = MapCSS.e_localize(tags, 'name');
208 | s_default['text-position'] = 'line';
209 | s_default['text-color'] = '#404040';
210 | s_default['font-family'] = 'DejaVu Sans Book';
211 | s_default['font-size'] = '9';
212 | s_default['text-halo-radius'] = 1;
213 | s_default['text-halo-color'] = '#ffffff';
214 | s_default['text-halo-radius'] = 1;
215 | s_default['text-halo-color'] = '#ffffff';
216 | s_default['casing-width'] = 0.5;
217 | s_default['casing-color'] = '#996703';
218 | s_default['width'] = 2;
219 | s_default['color'] = '#ffffff';
220 | s_default['z-index'] = 10;
221 | s_default['dashes'] = [9, 9];
222 | }
223 |
224 | if (((type === 'way' && tags['highway'] === 'construction') && zoom >= 17)) {
225 | s_default['text'] = MapCSS.e_localize(tags, 'name');
226 | s_default['text-position'] = 'line';
227 | s_default['text-color'] = '#404040';
228 | s_default['font-family'] = 'DejaVu Sans Book';
229 | s_default['font-size'] = '9';
230 | s_default['text-halo-radius'] = 1;
231 | s_default['text-halo-color'] = '#ffffff';
232 | s_default['text-halo-radius'] = 1;
233 | s_default['text-halo-color'] = '#ffffff';
234 | s_default['casing-width'] = 0.5;
235 | s_default['casing-color'] = '#996703';
236 | s_default['width'] = 3;
237 | s_default['color'] = '#ffffff';
238 | s_default['z-index'] = 10;
239 | s_default['dashes'] = [9, 9];
240 | }
241 |
242 | if (((type === 'way' && tags['highway'] === 'footway') && zoom >= 15) || ((type === 'way' && tags['highway'] === 'path') && zoom >= 15) || ((type === 'way' && tags['highway'] === 'cycleway') && zoom >= 15) || ((type === 'way' && tags['highway'] === 'pedestrian') && zoom >= 15)) {
243 | s_default['text'] = MapCSS.e_localize(tags, 'name');
244 | s_default['text-position'] = 'line';
245 | s_default['text-color'] = '#404040';
246 | s_default['font-family'] = 'DejaVu Sans Book';
247 | s_default['font-size'] = '9';
248 | s_default['text-halo-radius'] = 1;
249 | s_default['text-halo-color'] = '#ffffff';
250 | s_default['text-halo-radius'] = 1;
251 | s_default['text-halo-color'] = '#ffffff';
252 | s_default['casing-width'] = 0.3;
253 | s_default['casing-color'] = '#bf96ce';
254 | s_default['width'] = 0.2;
255 | s_default['color'] = '#ffffff';
256 | s_default['z-index'] = 10;
257 | s_default['dashes'] = [2, 2];
258 | }
259 |
260 | if (((type === 'way' && tags['highway'] === 'steps') && zoom >= 15)) {
261 | s_default['text'] = MapCSS.e_localize(tags, 'name');
262 | s_default['text-position'] = 'line';
263 | s_default['text-color'] = '#404040';
264 | s_default['font-family'] = 'DejaVu Sans Book';
265 | s_default['font-size'] = '9';
266 | s_default['text-halo-radius'] = 1;
267 | s_default['text-halo-color'] = '#ffffff';
268 | s_default['text-halo-radius'] = 1;
269 | s_default['text-halo-color'] = '#ffffff';
270 | s_default['casing-width'] = 0.3;
271 | s_default['casing-color'] = '#ffffff';
272 | s_default['width'] = 3;
273 | s_default['color'] = '#bf96ce';
274 | s_default['z-index'] = 10;
275 | s_default['dashes'] = [1, 1];
276 | s_default['linecap'] = 'butt';
277 | }
278 |
279 | if (((type === 'way' && tags['highway'] === 'road') && zoom === 12) || ((type === 'way' && tags['highway'] === 'track') && zoom === 12) || ((type === 'way' && tags['highway'] === 'residential') && zoom === 12) || ((type === 'way' && tags['highway'] === 'secondary') && zoom === 9) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom >= 9 && zoom <= 10) || ((type === 'way' && tags['highway'] === 'service' && (tags['living_street'] === '-1' || tags['living_street'] === 'false' || tags['living_street'] === 'no') && tags['service'] !== 'parking_aisle') && zoom === 14)) {
280 | s_default['width'] = 0.3;
281 | s_default['opacity'] = 0.6;
282 | s_default['color'] = '#996703';
283 | s_default['z-index'] = 10;
284 | }
285 |
286 | if (((type === 'way' && tags['highway'] === 'road') && zoom === 13) || ((type === 'way' && tags['highway'] === 'track') && zoom === 13)) {
287 | s_default['text'] = MapCSS.e_localize(tags, 'name');
288 | s_default['text-position'] = 'line';
289 | s_default['text-color'] = '#404040';
290 | s_default['font-family'] = 'DejaVu Sans Book';
291 | s_default['font-size'] = '9';
292 | s_default['text-halo-radius'] = 1;
293 | s_default['text-halo-color'] = '#ffffff';
294 | s_default['width'] = 0.6;
295 | s_default['opacity'] = 0.5;
296 | s_default['color'] = '#996703';
297 | s_default['z-index'] = 10;
298 | }
299 |
300 | if (((type === 'way' && tags['highway'] === 'road') && zoom >= 14 && zoom <= 16) || ((type === 'way' && tags['highway'] === 'track') && zoom >= 14 && zoom <= 16)) {
301 | s_default['text'] = MapCSS.e_localize(tags, 'name');
302 | s_default['text-position'] = 'line';
303 | s_default['text-color'] = '#404040';
304 | s_default['font-family'] = 'DejaVu Sans Book';
305 | s_default['font-size'] = '9';
306 | s_default['text-halo-radius'] = 1;
307 | s_default['text-halo-color'] = '#ffffff';
308 | s_default['width'] = 1.5;
309 | s_default['color'] = '#ffffff';
310 | s_default['casing-width'] = 0.5;
311 | s_default['casing-color'] = '#996703';
312 | s_default['z-index'] = 9;
313 | }
314 |
315 | if (((type === 'way' && tags['highway'] === 'road') && zoom >= 16) || ((type === 'way' && tags['highway'] === 'track') && zoom >= 16)) {
316 | s_default['text'] = MapCSS.e_localize(tags, 'name');
317 | s_default['text-position'] = 'line';
318 | s_default['text-color'] = '#404040';
319 | s_default['font-family'] = 'DejaVu Sans Book';
320 | s_default['font-size'] = '9';
321 | s_default['text-halo-radius'] = 1;
322 | s_default['text-halo-color'] = '#ffffff';
323 | s_default['width'] = 2.5;
324 | s_default['color'] = '#ffffff';
325 | s_default['casing-width'] = 0.5;
326 | s_default['casing-color'] = '#996703';
327 | s_default['z-index'] = 9;
328 | }
329 |
330 | if (((type === 'way' && tags['highway'] === 'residential') && zoom === 13)) {
331 | s_default['text'] = MapCSS.e_localize(tags, 'name');
332 | s_default['text-position'] = 'line';
333 | s_default['text-color'] = '#404040';
334 | s_default['font-family'] = 'DejaVu Sans Book';
335 | s_default['font-size'] = '9';
336 | s_default['text-halo-radius'] = 1;
337 | s_default['text-halo-color'] = '#ffffff';
338 | s_default['width'] = 1.2;
339 | s_default['color'] = '#ffffff';
340 | s_default['casing-width'] = 0.3;
341 | s_default['casing-color'] = '#996703';
342 | s_default['z-index'] = 10;
343 | }
344 |
345 | if (((type === 'way' && tags['highway'] === 'service' && (tags['living_street'] === '1' || tags['living_street'] === 'true' || tags['living_street'] === 'yes')) && zoom === 15) || ((type === 'way' && tags['highway'] === 'service' && tags['service'] === 'parking_aisle') && zoom === 15)) {
346 | s_default['width'] = 0.2;
347 | s_default['opacity'] = 0.5;
348 | s_default['color'] = '#996703';
349 | s_default['z-index'] = 10;
350 | }
351 |
352 | if (((type === 'way' && tags['highway'] === 'service' && (tags['living_street'] === '1' || tags['living_street'] === 'true' || tags['living_street'] === 'yes')) && zoom >= 16) || ((type === 'way' && tags['highway'] === 'service' && tags['service'] === 'parking_aisle') && zoom >= 16)) {
353 | s_default['text'] = MapCSS.e_localize(tags, 'name');
354 | s_default['text-position'] = 'line';
355 | s_default['text-color'] = '#404040';
356 | s_default['font-family'] = 'DejaVu Sans Book';
357 | s_default['font-size'] = '9';
358 | s_default['text-halo-radius'] = 1;
359 | s_default['text-halo-color'] = '#ffffff';
360 | s_default['width'] = 1.2;
361 | s_default['color'] = '#ffffff';
362 | s_default['casing-width'] = 0.3;
363 | s_default['casing-color'] = '#996703';
364 | s_default['z-index'] = 10;
365 | }
366 |
367 | if (((type === 'way' && tags['highway'] === 'residential') && zoom >= 14 && zoom <= 15) || ((type === 'way' && tags['highway'] === 'unclassified') && zoom >= 14 && zoom <= 15) || ((type === 'way' && tags['highway'] === 'service' && (tags['living_street'] === '-1' || tags['living_street'] === 'false' || tags['living_street'] === 'no') && tags['service'] !== 'parking_aisle') && zoom === 15)) {
368 | s_default['text'] = MapCSS.e_localize(tags, 'name');
369 | s_default['text-position'] = 'line';
370 | s_default['text-color'] = '#404040';
371 | s_default['font-family'] = 'DejaVu Sans Book';
372 | s_default['font-size'] = '9';
373 | s_default['text-halo-radius'] = 1;
374 | s_default['text-halo-color'] = '#ffffff';
375 | s_default['width'] = 2.5;
376 | s_default['color'] = '#ffffff';
377 | s_default['casing-width'] = 0.5;
378 | s_default['casing-color'] = '#996703';
379 | s_default['z-index'] = 10;
380 | }
381 |
382 | if (((type === 'way' && tags['highway'] === 'residential') && zoom === 16) || ((type === 'way' && tags['highway'] === 'unclassified') && zoom === 16) || ((type === 'way' && tags['highway'] === 'living_street') && zoom === 16) || ((type === 'way' && tags['highway'] === 'service' && (tags['living_street'] === '-1' || tags['living_street'] === 'false' || tags['living_street'] === 'no') && tags['service'] !== 'parking_aisle') && zoom === 16)) {
383 | s_default['text'] = MapCSS.e_localize(tags, 'name');
384 | s_default['text-position'] = 'line';
385 | s_default['text-color'] = '#404040';
386 | s_default['font-family'] = 'DejaVu Sans Book';
387 | s_default['font-size'] = '9';
388 | s_default['text-halo-radius'] = 1;
389 | s_default['text-halo-color'] = '#ffffff';
390 | s_default['width'] = 3.5;
391 | s_default['color'] = '#ffffff';
392 | s_default['casing-width'] = 0.5;
393 | s_default['casing-color'] = '#996703';
394 | s_default['z-index'] = 10;
395 | }
396 |
397 | if (((type === 'way' && tags['highway'] === 'residential') && zoom >= 17) || ((type === 'way' && tags['highway'] === 'unclassified') && zoom >= 17) || ((type === 'way' && tags['highway'] === 'living_street') && zoom >= 17) || ((type === 'way' && tags['highway'] === 'service' && (tags['living_street'] === '-1' || tags['living_street'] === 'false' || tags['living_street'] === 'no') && tags['service'] !== 'parking_aisle') && zoom >= 17)) {
398 | s_default['text'] = MapCSS.e_localize(tags, 'name');
399 | s_default['text-position'] = 'line';
400 | s_default['text-color'] = '#404040';
401 | s_default['font-family'] = 'DejaVu Sans Book';
402 | s_default['font-size'] = '9';
403 | s_default['text-halo-radius'] = 1;
404 | s_default['text-halo-color'] = '#ffffff';
405 | s_default['width'] = 4.5;
406 | s_default['color'] = '#ffffff';
407 | s_default['casing-width'] = 0.5;
408 | s_default['casing-color'] = '#996703';
409 | s_default['z-index'] = 10;
410 | }
411 |
412 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 10)) {
413 | s_default['text'] = MapCSS.e_localize(tags, 'name');
414 | s_default['text-position'] = 'line';
415 | s_default['width'] = 1.2;
416 | s_default['color'] = '#fcffd1';
417 | s_default['casing-width'] = 0.35;
418 | s_default['casing-color'] = '#996703';
419 | s_default['z-index'] = 11;
420 | }
421 |
422 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 11) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom === 11)) {
423 | s_default['text'] = MapCSS.e_localize(tags, 'name');
424 | s_default['text-position'] = 'line';
425 | s_default['text-color'] = '#404040';
426 | s_default['font-family'] = 'DejaVu Sans Book';
427 | s_default['font-size'] = '9';
428 | s_default['text-halo-radius'] = 1;
429 | s_default['text-halo-color'] = '#ffffff';
430 | s_default['text-halo-radius'] = 1;
431 | s_default['text-halo-color'] = '#ffffff';
432 | s_default['width'] = 1.4;
433 | s_default['color'] = '#fcffd1';
434 | s_default['casing-width'] = 0.35;
435 | s_default['casing-color'] = '#996703';
436 | s_default['z-index'] = 11;
437 | }
438 |
439 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 12) || ((type === 'way' && tags['highway'] === 'secondary_link') && zoom === 12) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom === 12) || ((type === 'way' && tags['highway'] === 'tertiary_link') && zoom === 12)) {
440 | s_default['text'] = MapCSS.e_localize(tags, 'name');
441 | s_default['text-position'] = 'line';
442 | s_default['text-color'] = '#404040';
443 | s_default['font-family'] = 'DejaVu Sans Book';
444 | s_default['font-size'] = '9';
445 | s_default['text-halo-radius'] = 1;
446 | s_default['text-halo-color'] = '#ffffff';
447 | s_default['text-halo-radius'] = 1;
448 | s_default['text-halo-color'] = '#ffffff';
449 | s_default['width'] = 3;
450 | s_default['color'] = '#fcffd1';
451 | s_default['casing-width'] = 0.35;
452 | s_default['casing-color'] = '#996703';
453 | s_default['z-index'] = 11;
454 | }
455 |
456 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 13) || ((type === 'way' && tags['highway'] === 'secondary_link') && zoom === 13) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom === 13) || ((type === 'way' && tags['highway'] === 'tertiary_link') && zoom === 13)) {
457 | s_default['text'] = MapCSS.e_localize(tags, 'name');
458 | s_default['text-position'] = 'line';
459 | s_default['text-color'] = '#404040';
460 | s_default['font-family'] = 'DejaVu Sans Book';
461 | s_default['font-size'] = '9';
462 | s_default['text-halo-radius'] = 1;
463 | s_default['text-halo-color'] = '#ffffff';
464 | s_default['width'] = 4;
465 | s_default['color'] = '#fcffd1';
466 | s_default['casing-width'] = 0.35;
467 | s_default['casing-color'] = '#996703';
468 | s_default['z-index'] = 11;
469 | }
470 |
471 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 14) || ((type === 'way' && tags['highway'] === 'secondary_link') && zoom === 14) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom === 14) || ((type === 'way' && tags['highway'] === 'tertiary_link') && zoom === 14)) {
472 | s_default['text'] = MapCSS.e_localize(tags, 'name');
473 | s_default['text-position'] = 'line';
474 | s_default['text-color'] = '#404040';
475 | s_default['font-family'] = 'DejaVu Sans Bold';
476 | s_default['font-size'] = '9';
477 | s_default['text-halo-radius'] = 1;
478 | s_default['text-halo-color'] = '#ffffff';
479 | s_default['width'] = 5;
480 | s_default['color'] = '#fcffd1';
481 | s_default['casing-width'] = 0.5;
482 | s_default['casing-color'] = '#996703';
483 | s_default['z-index'] = 11;
484 | }
485 |
486 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 15) || ((type === 'way' && tags['highway'] === 'secondary_link') && zoom === 15) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom === 15) || ((type === 'way' && tags['highway'] === 'tertiary_link') && zoom === 15)) {
487 | s_default['text'] = MapCSS.e_localize(tags, 'name');
488 | s_default['text-position'] = 'line';
489 | s_default['text-color'] = '#404040';
490 | s_default['font-family'] = 'DejaVu Sans Bold';
491 | s_default['font-size'] = '9';
492 | s_default['text-halo-radius'] = 1;
493 | s_default['text-halo-color'] = '#ffffff';
494 | s_default['width'] = 6;
495 | s_default['color'] = '#fcffd1';
496 | s_default['casing-width'] = 0.5;
497 | s_default['casing-color'] = '#996703';
498 | s_default['z-index'] = 11;
499 | }
500 |
501 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 16) || ((type === 'way' && tags['highway'] === 'secondary_link') && zoom === 16) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom === 16) || ((type === 'way' && tags['highway'] === 'tertiary_link') && zoom === 16)) {
502 | s_default['text'] = MapCSS.e_localize(tags, 'name');
503 | s_default['text-position'] = 'line';
504 | s_default['text-color'] = '#404040';
505 | s_default['font-family'] = 'DejaVu Sans Bold';
506 | s_default['font-size'] = '9';
507 | s_default['text-halo-radius'] = 1;
508 | s_default['text-halo-color'] = '#ffffff';
509 | s_default['width'] = 7;
510 | s_default['color'] = '#fcffd1';
511 | s_default['casing-width'] = 0.5;
512 | s_default['casing-color'] = '#996703';
513 | s_default['z-index'] = 11;
514 | }
515 |
516 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 17) || ((type === 'way' && tags['highway'] === 'secondary_link') && zoom === 17) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom === 17) || ((type === 'way' && tags['highway'] === 'tertiary_link') && zoom === 17)) {
517 | s_default['text'] = MapCSS.e_localize(tags, 'name');
518 | s_default['text-position'] = 'line';
519 | s_default['text-color'] = '#404040';
520 | s_default['font-family'] = 'DejaVu Sans Bold';
521 | s_default['font-size'] = '9';
522 | s_default['text-halo-radius'] = 1;
523 | s_default['text-halo-color'] = '#ffffff';
524 | s_default['width'] = 8;
525 | s_default['color'] = '#fcffd1';
526 | s_default['casing-width'] = 0.5;
527 | s_default['casing-color'] = '#996703';
528 | s_default['z-index'] = 11;
529 | }
530 |
531 | if (((type === 'way' && tags['highway'] === 'secondary') && zoom === 18) || ((type === 'way' && tags['highway'] === 'secondary_link') && zoom === 18) || ((type === 'way' && tags['highway'] === 'tertiary') && zoom === 18) || ((type === 'way' && tags['highway'] === 'tertiary_link') && zoom === 18)) {
532 | s_default['text'] = MapCSS.e_localize(tags, 'name');
533 | s_default['text-position'] = 'line';
534 | s_default['text-color'] = '#404040';
535 | s_default['font-family'] = 'DejaVu Sans Bold';
536 | s_default['font-size'] = '9';
537 | s_default['text-halo-radius'] = 1;
538 | s_default['text-halo-color'] = '#ffffff';
539 | s_default['width'] = 9;
540 | s_default['color'] = '#fcffd1';
541 | s_default['casing-width'] = 0.5;
542 | s_default['casing-color'] = '#996703';
543 | s_default['z-index'] = 11;
544 | }
545 |
546 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 7)) {
547 | s_default['width'] = 1;
548 | s_default['color'] = '#fcea97';
549 | s_default['z-index'] = 12;
550 | }
551 |
552 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 8)) {
553 | s_default['width'] = 2;
554 | s_default['color'] = '#fcea97';
555 | s_default['z-index'] = 12;
556 | }
557 |
558 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 9) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 9)) {
559 | s_default['text'] = MapCSS.e_localize(tags, 'name');
560 | s_default['text-position'] = 'line';
561 | s_default['text-color'] = '#404040';
562 | s_default['font-family'] = 'DejaVu Sans Bold';
563 | s_default['font-size'] = '9';
564 | s_default['text-halo-radius'] = 1;
565 | s_default['text-halo-color'] = '#ffffff';
566 | s_default['width'] = 2;
567 | s_default['color'] = '#fcea97';
568 | s_default['casing-width'] = 0.5;
569 | s_default['casing-color'] = '#996703';
570 | s_default['z-index'] = 12;
571 | }
572 |
573 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 10) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 10)) {
574 | s_default['text'] = MapCSS.e_localize(tags, 'name');
575 | s_default['text-position'] = 'line';
576 | s_default['text-color'] = '#404040';
577 | s_default['font-family'] = 'DejaVu Sans Bold';
578 | s_default['font-size'] = '9';
579 | s_default['text-halo-radius'] = 1;
580 | s_default['text-halo-color'] = '#ffffff';
581 | s_default['width'] = 3;
582 | s_default['color'] = '#fcea97';
583 | s_default['casing-width'] = 0.5;
584 | s_default['casing-color'] = '#996703';
585 | s_default['z-index'] = 12;
586 | }
587 |
588 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 11) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 11)) {
589 | s_default['text'] = MapCSS.e_localize(tags, 'name');
590 | s_default['text-position'] = 'line';
591 | s_default['text-color'] = '#404040';
592 | s_default['font-family'] = 'DejaVu Sans Bold';
593 | s_default['font-size'] = '9';
594 | s_default['text-halo-radius'] = 1;
595 | s_default['text-halo-color'] = '#ffffff';
596 | s_default['width'] = 4;
597 | s_default['color'] = '#fcea97';
598 | s_default['casing-width'] = 0.5;
599 | s_default['casing-color'] = '#996703';
600 | s_default['z-index'] = 12;
601 | }
602 |
603 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 12) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 12)) {
604 | s_default['text'] = MapCSS.e_localize(tags, 'name');
605 | s_default['text-position'] = 'line';
606 | s_default['text-color'] = '#404040';
607 | s_default['font-family'] = 'DejaVu Sans Bold';
608 | s_default['font-size'] = '9';
609 | s_default['text-halo-radius'] = 1;
610 | s_default['text-halo-color'] = '#ffffff';
611 | s_default['width'] = 5;
612 | s_default['color'] = '#fcea97';
613 | s_default['casing-width'] = 0.5;
614 | s_default['casing-color'] = '#996703';
615 | s_default['z-index'] = 12;
616 | }
617 |
618 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 13) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 13)) {
619 | s_default['text'] = MapCSS.e_localize(tags, 'name');
620 | s_default['text-position'] = 'line';
621 | s_default['text-color'] = '#404040';
622 | s_default['font-family'] = 'DejaVu Sans Bold';
623 | s_default['font-size'] = '9';
624 | s_default['text-halo-radius'] = 1;
625 | s_default['text-halo-color'] = '#ffffff';
626 | s_default['width'] = 6;
627 | s_default['color'] = '#fcea97';
628 | s_default['casing-width'] = 0.5;
629 | s_default['casing-color'] = '#996703';
630 | s_default['z-index'] = 12;
631 | }
632 |
633 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 14) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 14)) {
634 | s_default['text'] = MapCSS.e_localize(tags, 'name');
635 | s_default['text-position'] = 'line';
636 | s_default['text-color'] = '#404040';
637 | s_default['font-family'] = 'DejaVu Sans Bold';
638 | s_default['font-size'] = '9';
639 | s_default['text-halo-radius'] = 1;
640 | s_default['text-halo-color'] = '#ffffff';
641 | s_default['width'] = 7;
642 | s_default['color'] = '#fcea97';
643 | s_default['casing-width'] = 0.5;
644 | s_default['casing-color'] = '#996703';
645 | s_default['z-index'] = 12;
646 | }
647 |
648 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 15) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 15)) {
649 | s_default['text'] = MapCSS.e_localize(tags, 'name');
650 | s_default['text-position'] = 'line';
651 | s_default['text-color'] = '#404040';
652 | s_default['font-family'] = 'DejaVu Sans Bold';
653 | s_default['font-size'] = '9';
654 | s_default['text-halo-radius'] = 1;
655 | s_default['text-halo-color'] = '#ffffff';
656 | s_default['width'] = 8;
657 | s_default['color'] = '#fcea97';
658 | s_default['casing-width'] = 0.5;
659 | s_default['casing-color'] = '#996703';
660 | s_default['z-index'] = 12;
661 | }
662 |
663 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 16) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 16)) {
664 | s_default['text'] = MapCSS.e_localize(tags, 'name');
665 | s_default['text-position'] = 'line';
666 | s_default['text-color'] = '#404040';
667 | s_default['font-family'] = 'DejaVu Sans Bold';
668 | s_default['font-size'] = '9';
669 | s_default['text-halo-radius'] = 1;
670 | s_default['text-halo-color'] = '#ffffff';
671 | s_default['width'] = 9;
672 | s_default['color'] = '#fcea97';
673 | s_default['casing-width'] = 0.5;
674 | s_default['casing-color'] = '#996703';
675 | s_default['z-index'] = 12;
676 | }
677 |
678 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 17) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 17)) {
679 | s_default['text'] = MapCSS.e_localize(tags, 'name');
680 | s_default['text-position'] = 'line';
681 | s_default['text-color'] = '#404040';
682 | s_default['font-family'] = 'DejaVu Sans Bold';
683 | s_default['font-size'] = '9';
684 | s_default['text-halo-radius'] = 1;
685 | s_default['text-halo-color'] = '#ffffff';
686 | s_default['width'] = 10;
687 | s_default['color'] = '#fcea97';
688 | s_default['casing-width'] = 0.5;
689 | s_default['casing-color'] = '#996703';
690 | s_default['z-index'] = 12;
691 | }
692 |
693 | if (((type === 'way' && tags['highway'] === 'primary') && zoom === 18) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom === 18)) {
694 | s_default['text'] = MapCSS.e_localize(tags, 'name');
695 | s_default['text-position'] = 'line';
696 | s_default['text-color'] = '#404040';
697 | s_default['font-family'] = 'DejaVu Sans Bold';
698 | s_default['font-size'] = '9';
699 | s_default['text-halo-radius'] = 1;
700 | s_default['text-halo-color'] = '#ffffff';
701 | s_default['width'] = 11;
702 | s_default['color'] = '#fcea97';
703 | s_default['casing-width'] = 0.5;
704 | s_default['casing-color'] = '#996703';
705 | s_default['z-index'] = 12;
706 | }
707 |
708 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 6)) {
709 | s_default['width'] = 0.9;
710 | s_default['color'] = '#fbcd40';
711 | s_default['z-index'] = 13;
712 | }
713 |
714 | if (((type === 'way' && tags['highway'] === 'motorway') && zoom === 6)) {
715 | s_default['width'] = 1;
716 | s_default['color'] = '#fc9265';
717 | s_default['z-index'] = 13;
718 | }
719 |
720 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 7)) {
721 | s_default['width'] = 1;
722 | s_default['color'] = '#fbcd40';
723 | s_default['z-index'] = 13;
724 | }
725 |
726 | if (((type === 'way' && tags['highway'] === 'motorway') && zoom === 7)) {
727 | s_default['width'] = 1.2;
728 | s_default['color'] = '#fc9265';
729 | s_default['z-index'] = 13;
730 | }
731 |
732 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 8)) {
733 | s_default['width'] = 2;
734 | s_default['color'] = '#fbcd40';
735 | s_default['z-index'] = 13;
736 | }
737 |
738 | if (((type === 'way' && tags['highway'] === 'motorway') && zoom === 8)) {
739 | s_default['width'] = 2;
740 | s_default['color'] = '#fc9265';
741 | s_default['z-index'] = 13;
742 | }
743 |
744 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 9) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 9)) {
745 | s_default['text'] = MapCSS.e_localize(tags, 'name');
746 | s_default['text-position'] = 'line';
747 | s_default['text-color'] = '#404040';
748 | s_default['font-family'] = 'DejaVu Sans Bold';
749 | s_default['font-size'] = '9';
750 | s_default['text-halo-radius'] = 1;
751 | s_default['text-halo-color'] = '#ffffff';
752 | s_default['width'] = 3;
753 | s_default['color'] = '#ffd780';
754 | s_default['casing-width'] = 1;
755 | s_default['casing-color'] = '#996703';
756 | s_default['z-index'] = 13;
757 | }
758 |
759 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 10) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 10)) {
760 | s_default['text'] = MapCSS.e_localize(tags, 'name');
761 | s_default['text-position'] = 'line';
762 | s_default['text-color'] = '#404040';
763 | s_default['font-family'] = 'DejaVu Sans Bold';
764 | s_default['font-size'] = '9';
765 | s_default['text-halo-radius'] = 1;
766 | s_default['text-halo-color'] = '#ffffff';
767 | s_default['width'] = 4;
768 | s_default['color'] = '#ffd780';
769 | s_default['casing-width'] = 1;
770 | s_default['casing-color'] = '#996703';
771 | s_default['z-index'] = 13;
772 | }
773 |
774 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 11) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 11)) {
775 | s_default['text'] = MapCSS.e_localize(tags, 'name');
776 | s_default['text-position'] = 'line';
777 | s_default['text-color'] = '#404040';
778 | s_default['font-family'] = 'DejaVu Sans Bold';
779 | s_default['font-size'] = '9';
780 | s_default['text-halo-radius'] = 1;
781 | s_default['text-halo-color'] = '#ffffff';
782 | s_default['width'] = 5;
783 | s_default['color'] = '#ffd780';
784 | s_default['casing-width'] = 1;
785 | s_default['casing-color'] = '#996703';
786 | s_default['z-index'] = 13;
787 | }
788 |
789 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 12) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 12)) {
790 | s_default['text'] = MapCSS.e_localize(tags, 'name');
791 | s_default['text-position'] = 'line';
792 | s_default['text-color'] = '#404040';
793 | s_default['font-family'] = 'DejaVu Sans Bold';
794 | s_default['font-size'] = '9';
795 | s_default['text-halo-radius'] = 1;
796 | s_default['text-halo-color'] = '#ffffff';
797 | s_default['width'] = 7;
798 | s_default['color'] = '#ffd780';
799 | s_default['casing-width'] = 1;
800 | s_default['casing-color'] = '#996703';
801 | s_default['z-index'] = 13;
802 | }
803 |
804 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 13) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 13)) {
805 | s_default['text'] = MapCSS.e_localize(tags, 'name');
806 | s_default['text-position'] = 'line';
807 | s_default['text-color'] = '#404040';
808 | s_default['font-family'] = 'DejaVu Sans Bold';
809 | s_default['font-size'] = '9';
810 | s_default['text-halo-radius'] = 1;
811 | s_default['text-halo-color'] = '#ffffff';
812 | s_default['width'] = 8;
813 | s_default['color'] = '#ffd780';
814 | s_default['casing-width'] = 1;
815 | s_default['casing-color'] = '#996703';
816 | s_default['z-index'] = 13;
817 | }
818 |
819 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 14) || ((type === 'way' && tags['highway'] === 'trunk_link') && zoom === 14) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 14) || ((type === 'way' && tags['highway'] === 'motorway_link') && zoom === 14)) {
820 | s_default['text'] = MapCSS.e_localize(tags, 'name');
821 | s_default['text-position'] = 'line';
822 | s_default['text-color'] = '#404040';
823 | s_default['font-family'] = 'DejaVu Sans Bold';
824 | s_default['font-size'] = '9';
825 | s_default['text-halo-radius'] = 1;
826 | s_default['text-halo-color'] = '#ffffff';
827 | s_default['width'] = 9;
828 | s_default['color'] = '#ffd780';
829 | s_default['casing-width'] = 1;
830 | s_default['casing-color'] = '#996703';
831 | s_default['z-index'] = 13;
832 | }
833 |
834 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 15) || ((type === 'way' && tags['highway'] === 'trunk_link') && zoom === 15) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 15) || ((type === 'way' && tags['highway'] === 'motorway_link') && zoom === 15)) {
835 | s_default['text'] = MapCSS.e_localize(tags, 'name');
836 | s_default['text-position'] = 'line';
837 | s_default['text-color'] = '#404040';
838 | s_default['font-family'] = 'DejaVu Sans Bold';
839 | s_default['font-size'] = '9';
840 | s_default['text-halo-radius'] = 1;
841 | s_default['text-halo-color'] = '#ffffff';
842 | s_default['width'] = 10;
843 | s_default['color'] = '#ffd780';
844 | s_default['casing-width'] = 1;
845 | s_default['casing-color'] = '#996703';
846 | s_default['z-index'] = 13;
847 | }
848 |
849 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 16) || ((type === 'way' && tags['highway'] === 'trunk_link') && zoom === 16) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 16) || ((type === 'way' && tags['highway'] === 'motorway_link') && zoom === 16)) {
850 | s_default['text'] = MapCSS.e_localize(tags, 'name');
851 | s_default['text-position'] = 'line';
852 | s_default['text-color'] = '#404040';
853 | s_default['font-family'] = 'DejaVu Sans Bold';
854 | s_default['font-size'] = '9';
855 | s_default['text-halo-radius'] = 1;
856 | s_default['text-halo-color'] = '#ffffff';
857 | s_default['width'] = 11;
858 | s_default['color'] = '#ffd780';
859 | s_default['casing-width'] = 1;
860 | s_default['casing-color'] = '#996703';
861 | s_default['z-index'] = 13;
862 | }
863 |
864 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 17) || ((type === 'way' && tags['highway'] === 'trunk_link') && zoom === 17) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 17) || ((type === 'way' && tags['highway'] === 'motorway_link') && zoom === 17)) {
865 | s_default['text'] = MapCSS.e_localize(tags, 'name');
866 | s_default['text-position'] = 'line';
867 | s_default['text-color'] = '#404040';
868 | s_default['font-family'] = 'DejaVu Sans Bold';
869 | s_default['font-size'] = '9';
870 | s_default['text-halo-radius'] = 1;
871 | s_default['text-halo-color'] = '#ffffff';
872 | s_default['width'] = 12;
873 | s_default['color'] = '#ffd780';
874 | s_default['casing-width'] = 1;
875 | s_default['casing-color'] = '#996703';
876 | s_default['z-index'] = 13;
877 | }
878 |
879 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom === 18) || ((type === 'way' && tags['highway'] === 'trunk_link') && zoom === 18) || ((type === 'way' && tags['highway'] === 'motorway') && zoom === 18) || ((type === 'way' && tags['highway'] === 'motorway_link') && zoom === 18)) {
880 | s_default['text'] = MapCSS.e_localize(tags, 'name');
881 | s_default['text-position'] = 'line';
882 | s_default['text-color'] = '#404040';
883 | s_default['font-family'] = 'DejaVu Sans Bold';
884 | s_default['font-size'] = '9';
885 | s_default['text-halo-radius'] = 1;
886 | s_default['text-halo-color'] = '#ffffff';
887 | s_default['width'] = 13;
888 | s_default['color'] = '#ffd780';
889 | s_default['casing-width'] = 1;
890 | s_default['casing-color'] = '#996703';
891 | s_default['z-index'] = 13;
892 | }
893 |
894 | if (((type === 'way' && tags['highway'] === 'trunk') && zoom >= 9) || ((type === 'way' && tags['highway'] === 'trunk_link') && zoom >= 9) || ((type === 'way' && tags['highway'] === 'motorway') && zoom >= 9) || ((type === 'way' && tags['highway'] === 'motorway_link') && zoom >= 9) || ((type === 'way' && tags['highway'] === 'primary') && zoom >= 13) || ((type === 'way' && tags['highway'] === 'primary_link') && zoom >= 13)) {
895 | s_centerline['width'] = 0.3;
896 | s_centerline['color'] = '#fa6478';
897 | s_centerline['z-index'] = 14;
898 | s_centerline['-x-mapnik-layer'] = 'top';
899 | }
900 |
901 | if (((type === 'way' && (tags['oneway'] === '1' || tags['oneway'] === 'true' || tags['oneway'] === 'yes')) && zoom >= 17)) {
902 | s_default['line-style'] = 'arrows';
903 | s_default['z-index'] = 15;
904 | s_default['-x-mapnik-layer'] = 'top';
905 | }
906 |
907 | if (((selector === 'line' && tags['railway'] === 'rail') && zoom === 7)) {
908 | s_default['width'] = 0.5;
909 | s_default['color'] = '#303030';
910 | s_default['z-index'] = 15;
911 | }
912 |
913 | if (((selector === 'line' && tags['railway'] === 'rail') && zoom === 7)) {
914 | s_ticks['width'] = 0.3;
915 | s_ticks['color'] = '#ffffff';
916 | s_ticks['dashes'] = [3, 3];
917 | s_ticks['z-index'] = 16;
918 | }
919 |
920 | if (((selector === 'line' && tags['railway'] === 'rail') && zoom === 8)) {
921 | s_default['width'] = 0.6;
922 | s_default['color'] = '#303030';
923 | s_default['z-index'] = 15;
924 | }
925 |
926 | if (((selector === 'line' && tags['railway'] === 'rail') && zoom === 8)) {
927 | s_ticks['width'] = 0.35;
928 | s_ticks['color'] = '#ffffff';
929 | s_ticks['dashes'] = [3, 3];
930 | s_ticks['z-index'] = 16;
931 | }
932 |
933 | if (((selector === 'line' && tags['railway'] === 'rail') && zoom >= 9)) {
934 | s_default['width'] = 1.4;
935 | s_default['color'] = '#606060';
936 | s_default['z-index'] = 15;
937 | }
938 |
939 | if (((selector === 'line' && tags['railway'] === 'rail') && zoom >= 9)) {
940 | s_ticks['width'] = 1;
941 | s_ticks['color'] = '#ffffff';
942 | s_ticks['dashes'] = [6, 6];
943 | s_ticks['z-index'] = 16;
944 | }
945 |
946 | if (((type === 'way' && tags['railway'] === 'subway') && zoom >= 12)) {
947 | s_default['width'] = 3;
948 | s_default['color'] = '#072889';
949 | s_default['z-index'] = 15;
950 | s_default['dashes'] = [3, 3];
951 | s_default['opacity'] = 0.3;
952 | s_default['linecap'] = 'butt';
953 | s_default['-x-mapnik-layer'] = 'top';
954 | }
955 |
956 | if (((type === 'way' && tags['barrier'] === 'fence') && zoom >= 16)) {
957 | s_default['width'] = 0.3;
958 | s_default['color'] = 'black';
959 | s_default['z-index'] = 16;
960 | s_default['-x-mapnik-layer'] = 'top';
961 | }
962 |
963 | if (((type === 'way' && tags['barrier'] === 'wall') && zoom >= 16)) {
964 | s_default['width'] = 0.5;
965 | s_default['color'] = 'black';
966 | s_default['z-index'] = 16;
967 | s_default['-x-mapnik-layer'] = 'top';
968 | }
969 |
970 | if (((type === 'way' && tags['marking'] === 'sport' && (!tags.hasOwnProperty('colour')) && (!tags.hasOwnProperty('color'))) && zoom >= 15)) {
971 | s_default['width'] = 0.5;
972 | s_default['color'] = '#a0a0a0';
973 | s_default['z-index'] = 16;
974 | s_default['-x-mapnik-layer'] = 'top';
975 | }
976 |
977 | if (((type === 'way' && tags['marking'] === 'sport' && tags['colour'] === 'white') && zoom >= 15) || ((type === 'way' && tags['marking'] === 'sport' && tags['color'] === 'white') && zoom >= 15)) {
978 | s_default['width'] = 1;
979 | s_default['color'] = 'white';
980 | s_default['z-index'] = 16;
981 | s_default['-x-mapnik-layer'] = 'top';
982 | }
983 |
984 | if (((type === 'way' && tags['marking'] === 'sport' && tags['colour'] === 'red') && zoom >= 15) || ((type === 'way' && tags['marking'] === 'sport' && tags['color'] === 'red') && zoom >= 15)) {
985 | s_default['width'] = 1;
986 | s_default['color'] = '#c00000';
987 | s_default['z-index'] = 16;
988 | s_default['-x-mapnik-layer'] = 'top';
989 | }
990 |
991 | if (((type === 'way' && tags['marking'] === 'sport' && tags['colour'] === 'black') && zoom >= 15) || ((type === 'way' && tags['marking'] === 'sport' && tags['color'] === 'black') && zoom >= 15)) {
992 | s_default['width'] = 1;
993 | s_default['color'] = 'black';
994 | s_default['z-index'] = 16;
995 | s_default['-x-mapnik-layer'] = 'top';
996 | }
997 |
998 | if (((type === 'node' && tags['amenity'] === 'bus_station') && zoom >= 15)) {
999 | s_default['icon-image'] = 'aut2_16x16_park.png';
1000 | }
1001 |
1002 | if (((type === 'node' && tags['highway'] === 'bus_stop') && zoom >= 16)) {
1003 | s_default['icon-image'] = 'autobus_stop_14x10.png';
1004 | }
1005 |
1006 | if (((type === 'node' && tags['railway'] === 'tram_stop') && zoom >= 16)) {
1007 | s_default['icon-image'] = 'tramway_14x13.png';
1008 | }
1009 |
1010 | if (((type === 'node' && tags['amenity'] === 'fuel') && zoom >= 15)) {
1011 | s_default['icon-image'] = 'tankstelle1_10x11.png';
1012 | }
1013 |
1014 | if (((type === 'node' && tags['amenity'] === 'pharmacy') && zoom >= 16)) {
1015 | s_default['icon-image'] = 'med1_11x14.png';
1016 | }
1017 |
1018 | if (((type === 'node' && tags['amenity'] === 'cinema') && zoom >= 16)) {
1019 | s_default['icon-image'] = 'cinema_14x14.png';
1020 | }
1021 |
1022 | if (((type === 'node' && tags['amenity'] === 'museum') && zoom >= 15)) {
1023 | s_default['icon-image'] = 'mus_13x12.png';
1024 | }
1025 |
1026 | if (((type === 'node' && tags['tourism'] === 'zoo') && zoom >= 16)) {
1027 | s_default['icon-image'] = 'zoo4_14x14.png';
1028 | }
1029 |
1030 | if (((type === 'node' && tags['amenity'] === 'courthouse') && zoom >= 16)) {
1031 | s_default['icon-image'] = 'sud_14x13.png';
1032 | }
1033 |
1034 | if (((type === 'node' && tags['amenity'] === 'theatre') && zoom >= 16)) {
1035 | s_default['icon-image'] = 'teater_14x14.png';
1036 | }
1037 |
1038 | if (((type === 'node' && tags['amenity'] === 'university') && zoom >= 16)) {
1039 | s_default['icon-image'] = 'univer_15x11.png';
1040 | }
1041 |
1042 | if (((type === 'node' && tags['amenity'] === 'toilets') && zoom >= 16)) {
1043 | s_default['icon-image'] = 'wc-3_13x13.png';
1044 | }
1045 |
1046 | if (((type === 'node' && tags['amenity'] === 'place_of_worship' && tags['religion'] === 'christian') && zoom >= 16)) {
1047 | s_default['icon-image'] = 'pravosl_kupol_11x15.png';
1048 | }
1049 |
1050 | if (((selector === 'area' && tags['amenity'] === 'place_of_worship' && tags['religion'] === 'christian') && zoom >= 16)) {
1051 | s_default['icon-image'] = 'pravosl_kupol_11x15.png';
1052 | }
1053 |
1054 | if (((type === 'node' && tags['amenity'] === 'place_of_worship') && zoom >= 14)) {
1055 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1056 | s_default['text-color'] = '#623f00';
1057 | s_default['font-family'] = 'DejaVu Serif Italic';
1058 | s_default['font-size'] = '9';
1059 | s_default['text-halo-radius'] = 1;
1060 | s_default['text-halo-color'] = '#ffffff';
1061 | s_default['text-offset'] = 3;
1062 | s_default['max-width'] = 70;
1063 | }
1064 |
1065 | if (((selector === 'area' && tags['amenity'] === 'place_of_worship') && zoom >= 14)) {
1066 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1067 | s_default['text-color'] = '#623f00';
1068 | s_default['font-family'] = 'DejaVu Serif Italic';
1069 | s_default['font-size'] = '9';
1070 | s_default['text-halo-radius'] = 1;
1071 | s_default['text-halo-color'] = '#ffffff';
1072 | s_default['text-offset'] = 3;
1073 | s_default['max-width'] = 70;
1074 | s_default['z-index'] = 16;
1075 | s_default['width'] = 0.1;
1076 | s_default['color'] = '#111111';
1077 | s_default['text-opacity'] = '1';
1078 | s_default['fill-color'] = '#777777';
1079 | s_default['fill-opacity'] = 0.5;
1080 | }
1081 |
1082 | if (((type === 'node' && tags['amenity'] === 'kindergarten') && zoom >= 17)) {
1083 | s_default['icon-image'] = 'kindergarten_14x14.png';
1084 | }
1085 |
1086 | if (((type === 'node' && tags['amenity'] === 'school') && zoom >= 17)) {
1087 | s_default['icon-image'] = 'school_13x13.png';
1088 | }
1089 |
1090 | if (((type === 'node' && tags['amenity'] === 'library') && zoom >= 17)) {
1091 | s_default['icon-image'] = 'lib_13x14.png';
1092 | }
1093 |
1094 | if (((type === 'node' && tags['tourism'] === 'hotel') && zoom >= 17)) {
1095 | s_default['icon-image'] = 'hotell_14x14.png';
1096 | }
1097 |
1098 | if (((type === 'node' && tags['amenity'] === 'post_office') && zoom >= 17)) {
1099 | s_default['icon-image'] = 'post_14x11.png';
1100 | }
1101 |
1102 | if (((type === 'node' && tags['amenity'] === 'restaurant') && zoom >= 17)) {
1103 | s_default['icon-image'] = 'rest_14x14.png';
1104 | }
1105 |
1106 | if (((type === 'node' && (tags.hasOwnProperty('shop'))) && zoom >= 17)) {
1107 | s_default['icon-image'] = 'superm_12x12.png';
1108 | }
1109 |
1110 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '2'))) {
1111 | s_default['width'] = 0.5;
1112 | s_default['color'] = '#202020';
1113 | s_default['dashes'] = [6, 4];
1114 | s_default['opacity'] = 0.7;
1115 | s_default['z-index'] = 16;
1116 | }
1117 |
1118 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '3') && zoom === 3)) {
1119 | s_default['width'] = 0.4;
1120 | s_default['color'] = '#7e0156';
1121 | s_default['dashes'] = [3, 3];
1122 | s_default['opacity'] = 0.5;
1123 | s_default['z-index'] = 16;
1124 | }
1125 |
1126 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '3') && zoom >= 4)) {
1127 | s_default['width'] = 1.3;
1128 | s_default['color'] = '#ff99cc';
1129 | s_default['opacity'] = 0.5;
1130 | s_default['z-index'] = 16;
1131 | }
1132 |
1133 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '6') && zoom >= 10)) {
1134 | s_default['width'] = 0.5;
1135 | s_default['color'] = '#101010';
1136 | s_default['dashes'] = [1, 2];
1137 | s_default['opacity'] = 0.6;
1138 | s_default['z-index'] = 16.1;
1139 | }
1140 |
1141 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '4') && zoom >= 4 && zoom <= 5)) {
1142 | s_default['width'] = 0.3;
1143 | s_default['color'] = '#000000';
1144 | s_default['dashes'] = [1, 2];
1145 | s_default['opacity'] = 0.8;
1146 | s_default['z-index'] = 16.3;
1147 | }
1148 |
1149 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '4') && zoom >= 6)) {
1150 | s_default['width'] = 0.7;
1151 | s_default['color'] = '#000000';
1152 | s_default['dashes'] = [1, 2];
1153 | s_default['opacity'] = 0.8;
1154 | s_default['z-index'] = 16.3;
1155 | }
1156 |
1157 | if (((type === 'way' && tags['railway'] === 'tram') && zoom >= 12)) {
1158 | s_default['line-style'] = 'rway44.png';
1159 | s_default['z-index'] = 17;
1160 | }
1161 |
1162 | if (((type === 'node' && tags['railway'] === 'station' && tags['transport'] !== 'subway') && zoom >= 9)) {
1163 | s_default['icon-image'] = 'rw_stat_stanzii_2_blue.png';
1164 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1165 | s_default['text-offset'] = 7;
1166 | s_default['font-size'] = '9';
1167 | s_default['font-family'] = 'DejaVu Sans Mono Book';
1168 | s_default['text-halo-radius'] = 1;
1169 | s_default['text-color'] = '#000d6c';
1170 | s_default['text-halo-color'] = '#ffffff';
1171 | s_default['text-allow-overlap'] = 'false';
1172 | s_default['-x-mapnik-min-distance'] = '0';
1173 | }
1174 |
1175 | if (((type === 'node' && tags['railway'] === 'station' && tags['transport'] === 'subway') && zoom >= 12 && zoom <= 15)) {
1176 | s_default['icon-image'] = 'metro_others6.png';
1177 | s_default['z-index'] = 17;
1178 | }
1179 |
1180 | if (((type === 'node' && tags['railway'] === 'station' && tags['transport'] === 'subway') && zoom >= 12 && zoom <= 15)) {
1181 | s_label['text'] = MapCSS.e_localize(tags, 'name');
1182 | s_label['text-offset'] = 11;
1183 | s_label['font-size'] = '9';
1184 | s_label['font-family'] = 'DejaVu Sans Book';
1185 | s_label['text-halo-radius'] = 2;
1186 | s_label['text-color'] = '#1300bb';
1187 | s_label['text-halo-color'] = '#ffffff';
1188 | s_label['text-allow-overlap'] = 'false';
1189 | s_label['-x-mapnik-min-distance'] = '0';
1190 | }
1191 |
1192 | if (((type === 'node' && tags['railway'] === 'subway_entrance') && zoom >= 16)) {
1193 | s_default['icon-image'] = 'metro_others6.png';
1194 | s_default['z-index'] = 17;
1195 | }
1196 |
1197 | if (((type === 'node' && tags['railway'] === 'subway_entrance' && (tags.hasOwnProperty('name'))) && zoom >= 16)) {
1198 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1199 | s_default['text-offset'] = 11;
1200 | s_default['font-size'] = '9';
1201 | s_default['font-family'] = 'DejaVu Sans Book';
1202 | s_default['text-halo-radius'] = 2;
1203 | s_default['text-color'] = '#1300bb';
1204 | s_default['text-halo-color'] = '#ffffff';
1205 | s_default['text-allow-overlap'] = 'false';
1206 | s_default['-x-mapnik-min-distance'] = '0';
1207 | }
1208 |
1209 | if (((type === 'node' && tags['aeroway'] === 'aerodrome') && zoom >= 10)) {
1210 | s_default['icon-image'] = 'airport_world.png';
1211 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1212 | s_default['text-offset'] = 12;
1213 | s_default['font-size'] = '9';
1214 | s_default['font-family'] = 'DejaVu Sans Condensed Bold';
1215 | s_default['text-halo-radius'] = 1;
1216 | s_default['text-color'] = '#1e7ca5';
1217 | s_default['text-halo-color'] = '#ffffff';
1218 | s_default['text-allow-overlap'] = 'false';
1219 | s_default['z-index'] = 17;
1220 | }
1221 |
1222 | if (((type === 'node' && (tags['capital'] === '1' || tags['capital'] === 'true' || tags['capital'] === 'yes') && tags['population'] > '5000000') && zoom >= 3 && zoom <= 6)) {
1223 | s_default['icon-image'] = 'adm_5.png';
1224 | s_default['allow-overlap'] = 'true';
1225 | }
1226 |
1227 | if (((type === 'node' && (tags['capital'] === '1' || tags['capital'] === 'true' || tags['capital'] === 'yes') && tags['population'] > '5000000') && zoom === 3)) {
1228 | s_default['text-offset'] = 4;
1229 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1230 | s_default['font-size'] = '8';
1231 | s_default['font-family'] = 'DejaVu Sans Bold';
1232 | s_default['text-halo-radius'] = 1;
1233 | s_default['text-color'] = '#505050';
1234 | s_default['text-halo-color'] = '#ffffff';
1235 | s_default['text-allow-overlap'] = 'false';
1236 | s_default['-x-mapnik-min-distance'] = '0';
1237 | s_default['text-align'] = 'left';
1238 | }
1239 |
1240 | if (((type === 'node' && (tags['capital'] === '1' || tags['capital'] === 'true' || tags['capital'] === 'yes') && tags['population'] > '5000000') && zoom >= 4 && zoom <= 6)) {
1241 | s_default['text-offset'] = 6;
1242 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1243 | s_default['font-size'] = '10';
1244 | s_default['font-family'] = 'DejaVu Sans Bold';
1245 | s_default['text-halo-radius'] = 1;
1246 | s_default['text-color'] = '#303030';
1247 | s_default['text-halo-color'] = '#ffffff';
1248 | s_default['text-allow-overlap'] = 'false';
1249 | s_default['-x-mapnik-min-distance'] = '0';
1250 | s_default['text-align'] = 'left';
1251 | }
1252 |
1253 | if (((type === 'node' && (tags.hasOwnProperty('place')) && tags['population'] < '100000' && (tags.hasOwnProperty('capital')) && tags['admin_level'] < '5') && zoom >= 4 && zoom <= 5)) {
1254 | s_default['icon-image'] = 'adm_4.png';
1255 | s_default['text-offset'] = 5;
1256 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1257 | s_default['font-size'] = '7';
1258 | s_default['font-family'] = 'DejaVu Sans Bold';
1259 | s_default['text-halo-radius'] = 1;
1260 | s_default['text-color'] = '#404040';
1261 | s_default['text-halo-color'] = '#ffffff';
1262 | s_default['text-allow-overlap'] = 'false';
1263 | s_default['-x-mapnik-min-distance'] = '0';
1264 | }
1265 |
1266 | if (((type === 'node' && (tags.hasOwnProperty('place')) && tags['population'] >= '100000' && tags['population'] <= '5000000' && (tags.hasOwnProperty('capital')) && tags['admin_level'] < '5') && zoom >= 4 && zoom <= 5)) {
1267 | s_default['icon-image'] = 'adm_5.png';
1268 | s_default['text-offset'] = 5;
1269 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1270 | s_default['font-size'] = '8';
1271 | s_default['font-family'] = 'DejaVu Sans Bold';
1272 | s_default['text-halo-radius'] = 1;
1273 | s_default['text-color'] = '#404040';
1274 | s_default['text-halo-color'] = '#ffffff';
1275 | s_default['text-allow-overlap'] = 'false';
1276 | s_default['-x-mapnik-min-distance'] = '0';
1277 | s_default['z-index'] = 1;
1278 | }
1279 |
1280 | if (((type === 'node' && tags['place'] === 'town' && (tags.hasOwnProperty('capital'))) && zoom === 5)) {
1281 | s_default['icon-image'] = 'town_4.png';
1282 | }
1283 |
1284 | if (((type === 'node' && tags['place'] === 'city' && tags['population'] < '100000') && zoom === 6) || ((type === 'node' && tags['place'] === 'town' && tags['population'] < '100000' && (tags.hasOwnProperty('admin_level'))) && zoom === 6)) {
1285 | s_default['icon-image'] = 'adm1_4_6.png';
1286 | s_default['text-offset'] = 5;
1287 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1288 | s_default['font-size'] = '8';
1289 | s_default['font-family'] = 'DejaVu Sans Bold';
1290 | s_default['text-halo-radius'] = 1;
1291 | s_default['text-color'] = '#202020';
1292 | s_default['text-halo-color'] = '#ffffff';
1293 | s_default['text-allow-overlap'] = 'false';
1294 | s_default['-x-mapnik-min-distance'] = '0';
1295 | }
1296 |
1297 | if (((type === 'node' && tags['place'] === 'city' && tags['population'] < '100000') && zoom === 7) || ((type === 'node' && tags['place'] === 'town' && tags['population'] < '100000') && zoom === 7)) {
1298 | s_default['icon-image'] = 'town_6.png';
1299 | s_default['text-offset'] = 5;
1300 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1301 | s_default['font-size'] = '9';
1302 | s_default['font-family'] = 'DejaVu Sans Bold';
1303 | s_default['text-halo-radius'] = 1;
1304 | s_default['text-color'] = '#202020';
1305 | s_default['text-halo-color'] = '#ffffff';
1306 | s_default['text-allow-overlap'] = 'false';
1307 | s_default['-x-mapnik-min-distance'] = '0';
1308 | }
1309 |
1310 | if (((type === 'node' && tags['place'] === 'town' && (!tags.hasOwnProperty('population'))) && zoom === 7) || ((type === 'node' && tags['place'] === 'city' && (!tags.hasOwnProperty('population'))) && zoom === 7)) {
1311 | s_default['icon-image'] = 'town_6.png';
1312 | s_default['text-offset'] = 5;
1313 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1314 | s_default['font-size'] = '8';
1315 | s_default['font-family'] = 'DejaVu Sans Bold';
1316 | s_default['text-halo-radius'] = 1;
1317 | s_default['text-color'] = '#202020';
1318 | s_default['text-halo-color'] = '#ffffff';
1319 | s_default['text-allow-overlap'] = 'false';
1320 | s_default['-x-mapnik-min-distance'] = '0';
1321 | }
1322 |
1323 | if (((type === 'node' && tags['place'] === 'town') && zoom === 8)) {
1324 | s_default['icon-image'] = 'town_6.png';
1325 | s_default['text-offset'] = 5;
1326 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1327 | s_default['font-size'] = '8';
1328 | s_default['font-family'] = 'DejaVu Sans Bold';
1329 | s_default['text-halo-radius'] = 1;
1330 | s_default['text-color'] = '#202020';
1331 | s_default['text-halo-color'] = '#ffffff';
1332 | s_default['text-allow-overlap'] = 'false';
1333 | s_default['-x-mapnik-min-distance'] = '0';
1334 | }
1335 |
1336 | if (((type === 'node' && tags['place'] === 'city' && tags['population'] >= '100000' && tags['population'] <= '1000000') && zoom >= 6 && zoom <= 8) || ((type === 'node' && tags['place'] === 'town' && tags['population'] >= '100000' && tags['population'] <= '1000000' && (tags.hasOwnProperty('admin_level'))) && zoom === 6)) {
1337 | s_default['icon-image'] = 'adm1_5.png';
1338 | s_default['text-offset'] = 5;
1339 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1340 | s_default['font-size'] = '9';
1341 | s_default['font-family'] = 'DejaVu Sans Bold';
1342 | s_default['text-halo-radius'] = 1;
1343 | s_default['text-color'] = '#303030';
1344 | s_default['text-halo-color'] = '#ffffff';
1345 | s_default['text-allow-overlap'] = 'false';
1346 | s_default['-x-mapnik-min-distance'] = '0';
1347 | }
1348 |
1349 | if (((type === 'node' && tags['place'] === 'city' && tags['population'] >= '100000' && tags['population'] <= '1000000') && zoom >= 7 && zoom <= 8) || ((type === 'node' && tags['place'] === 'town' && tags['population'] >= '100000' && tags['population'] <= '1000000') && zoom === 7)) {
1350 | s_default['icon-image'] = 'adm1_5.png';
1351 | s_default['text-offset'] = 5;
1352 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1353 | s_default['font-size'] = '10';
1354 | s_default['font-family'] = 'DejaVu Sans Bold';
1355 | s_default['text-halo-radius'] = 1;
1356 | s_default['text-color'] = '#303030';
1357 | s_default['text-halo-color'] = '#ffffff';
1358 | s_default['text-allow-overlap'] = 'false';
1359 | s_default['-x-mapnik-min-distance'] = '0';
1360 | }
1361 |
1362 | if (((type === 'node' && tags['place'] === 'city' && tags['population'] > '1000000') && zoom === 6)) {
1363 | s_default['icon-image'] = 'adm1_6_test2.png';
1364 | s_default['text-offset'] = 5;
1365 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1366 | s_default['font-size'] = '10';
1367 | s_default['font-family'] = 'DejaVu Sans Bold';
1368 | s_default['text-halo-radius'] = 1;
1369 | s_default['text-color'] = '#404040';
1370 | s_default['text-halo-color'] = '#ffffff';
1371 | s_default['text-allow-overlap'] = 'false';
1372 | s_default['-x-mapnik-min-distance'] = '0';
1373 | s_default['z-index'] = 1;
1374 | }
1375 |
1376 | if (((type === 'node' && tags['place'] === 'city' && tags['population'] > '1000000' && tags['population'] < '5000000') && zoom >= 7 && zoom <= 8)) {
1377 | s_default['icon-image'] = 'adm1_6_test2.png';
1378 | s_default['text-offset'] = 5;
1379 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1380 | s_default['font-size'] = '11';
1381 | s_default['font-family'] = 'DejaVu Sans Bold';
1382 | s_default['text-halo-radius'] = 1;
1383 | s_default['text-color'] = '#404040';
1384 | s_default['text-halo-color'] = '#ffffff';
1385 | s_default['text-allow-overlap'] = 'false';
1386 | s_default['-x-mapnik-min-distance'] = '0';
1387 | s_default['z-index'] = 2;
1388 | }
1389 |
1390 | if (((type === 'node' && tags['place'] === 'city' && tags['population'] >= '5000000') && zoom >= 7 && zoom <= 8)) {
1391 | s_default['icon-image'] = 'adm_6.png';
1392 | s_default['text-offset'] = 5;
1393 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1394 | s_default['font-size'] = '12';
1395 | s_default['font-family'] = 'DejaVu Sans Bold';
1396 | s_default['text-halo-radius'] = 1;
1397 | s_default['text-color'] = '#404040';
1398 | s_default['text-halo-color'] = '#ffffff';
1399 | s_default['text-allow-overlap'] = 'false';
1400 | s_default['-x-mapnik-min-distance'] = '0';
1401 | s_default['z-index'] = 3;
1402 | }
1403 |
1404 | if (((type === 'node' && tags['place'] === 'city' && (tags['capital'] === '1' || tags['capital'] === 'true' || tags['capital'] === 'yes')) && zoom >= 9 && zoom <= 11)) {
1405 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1406 | s_default['text-offset'] = -20;
1407 | s_default['font-size'] = '14';
1408 | s_default['font-family'] = 'DejaVu Sans Bold';
1409 | s_default['text-halo-radius'] = 4;
1410 | s_default['text-color'] = '#101010';
1411 | s_default['text-halo-color'] = '#ffffff';
1412 | s_default['text-allow-overlap'] = 'false';
1413 | s_default['-x-mapnik-min-distance'] = '50';
1414 | s_default['z-index'] = 20;
1415 | }
1416 |
1417 | if (((type === 'node' && tags['place'] === 'city' && (tags['capital'] === '-1' || tags['capital'] === 'false' || tags['capital'] === 'no')) && zoom >= 9 && zoom <= 11)) {
1418 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1419 | s_default['text-offset'] = -20;
1420 | s_default['font-size'] = '14';
1421 | s_default['font-family'] = 'DejaVu Sans Bold';
1422 | s_default['text-halo-radius'] = 2;
1423 | s_default['text-color'] = '#101010';
1424 | s_default['text-halo-color'] = '#ffffff';
1425 | s_default['text-allow-overlap'] = 'false';
1426 | s_default['-x-mapnik-min-distance'] = '0';
1427 | s_default['z-index'] = 1;
1428 | }
1429 |
1430 | if (((type === 'node' && tags['place'] === 'town') && zoom === 11)) {
1431 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1432 | s_default['font-size'] = '12';
1433 | s_default['font-family'] = 'DejaVu Sans Book';
1434 | s_default['text-color'] = '#101010';
1435 | s_default['text-halo-radius'] = 1;
1436 | s_default['text-halo-color'] = '#ffffff';
1437 | s_default['z-index'] = 20;
1438 | }
1439 |
1440 | if (((type === 'node' && tags['place'] === 'town') && zoom === 12)) {
1441 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1442 | s_default['font-size'] = '20';
1443 | s_default['font-family'] = 'DejaVu Sans Book';
1444 | s_default['text-color'] = '#101010';
1445 | s_default['text-opacity'] = '0.2';
1446 | s_default['text-allow-overlap'] = 'true';
1447 | s_default['z-index'] = 20;
1448 | }
1449 |
1450 | if (((type === 'node' && tags['place'] === 'city') && zoom === 12)) {
1451 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1452 | s_default['font-size'] = '25';
1453 | s_default['font-family'] = 'DejaVu Sans Book';
1454 | s_default['text-color'] = '#101010';
1455 | s_default['text-opacity'] = '0.3';
1456 | s_default['text-allow-overlap'] = 'true';
1457 | s_default['z-index'] = 20;
1458 | }
1459 |
1460 | if (((type === 'node' && tags['place'] === 'town') && zoom === 13)) {
1461 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1462 | s_default['font-size'] = '40';
1463 | s_default['font-family'] = 'DejaVu Sans Book';
1464 | s_default['text-color'] = '#101010';
1465 | s_default['text-opacity'] = '0.2';
1466 | s_default['text-allow-overlap'] = 'true';
1467 | s_default['z-index'] = 20;
1468 | }
1469 |
1470 | if (((type === 'node' && tags['place'] === 'city') && zoom === 13)) {
1471 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1472 | s_default['font-size'] = '50';
1473 | s_default['font-family'] = 'DejaVu Sans Book';
1474 | s_default['text-color'] = '#101010';
1475 | s_default['text-opacity'] = '0.3';
1476 | s_default['text-allow-overlap'] = 'true';
1477 | s_default['z-index'] = 20;
1478 | }
1479 |
1480 | if (((type === 'node' && tags['place'] === 'town') && zoom >= 14)) {
1481 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1482 | s_default['font-size'] = '80';
1483 | s_default['font-family'] = 'DejaVu Sans Book';
1484 | s_default['text-color'] = '#101010';
1485 | s_default['text-opacity'] = '0.2';
1486 | s_default['text-allow-overlap'] = 'true';
1487 | s_default['z-index'] = 20;
1488 | }
1489 |
1490 | if (((type === 'node' && tags['place'] === 'city') && zoom >= 14)) {
1491 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1492 | s_default['font-size'] = '100';
1493 | s_default['font-family'] = 'DejaVu Sans Book';
1494 | s_default['text-color'] = '#101010';
1495 | s_default['text-opacity'] = '0.3';
1496 | s_default['text-allow-overlap'] = 'true';
1497 | s_default['z-index'] = 20;
1498 | }
1499 |
1500 | if (((type === 'node' && tags['place'] === 'village') && zoom >= 9)) {
1501 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1502 | s_default['text-offset'] = 1;
1503 | s_default['font-size'] = '9';
1504 | s_default['font-family'] = 'DejaVu Sans Book';
1505 | s_default['text-halo-radius'] = 1;
1506 | s_default['text-color'] = '#606060';
1507 | s_default['text-halo-color'] = '#ffffff';
1508 | s_default['text-allow-overlap'] = 'false';
1509 | }
1510 |
1511 | if (((type === 'node' && tags['place'] === 'hamlet') && zoom >= 9)) {
1512 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1513 | s_default['text-offset'] = 1;
1514 | s_default['font-size'] = '8';
1515 | s_default['font-family'] = 'DejaVu Sans Book';
1516 | s_default['text-halo-radius'] = 1;
1517 | s_default['text-color'] = '#505050';
1518 | s_default['text-halo-color'] = '#ffffff';
1519 | s_default['text-allow-overlap'] = 'false';
1520 | }
1521 |
1522 | if (((selector === 'area' && tags['landuse'] === 'nature_reserve') && zoom >= 9) || ((selector === 'area' && tags['leisure'] === 'park') && zoom >= 11)) {
1523 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1524 | s_default['text-offset'] = 1;
1525 | s_default['font-size'] = '10';
1526 | s_default['font-family'] = 'DejaVu Serif Italic';
1527 | s_default['text-halo-radius'] = 0;
1528 | s_default['text-color'] = '#3c8000';
1529 | s_default['text-halo-color'] = '#ffffff';
1530 | s_default['text-allow-overlap'] = 'false';
1531 | }
1532 |
1533 | if (((type === 'way' && tags['waterway'] === 'stream') && zoom >= 10) || ((type === 'way' && tags['waterway'] === 'river') && zoom >= 9) || ((type === 'way' && tags['waterway'] === 'canal') && zoom >= 13)) {
1534 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1535 | s_default['font-size'] = '9';
1536 | s_default['font-family'] = 'DejaVu Sans Oblique';
1537 | s_default['text-color'] = '#547bd1';
1538 | s_default['text-halo-radius'] = 1;
1539 | s_default['text-halo-color'] = '#ffffff';
1540 | s_default['text-position'] = 'line';
1541 | }
1542 |
1543 | if (((type === 'node' && tags['place'] === 'continent') && zoom <= 3)) {
1544 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1545 | s_default['text-offset'] = -10;
1546 | s_default['font-size'] = '10';
1547 | s_default['font-family'] = 'DejaVu Sans ExtraLight';
1548 | s_default['text-halo-radius'] = 1;
1549 | s_default['text-color'] = '#202020';
1550 | s_default['text-halo-color'] = '#ffffff';
1551 | s_default['z-index'] = -1;
1552 | s_default['-x-mapnik-min-distance'] = '0';
1553 | }
1554 |
1555 | if (((type === 'node' && tags['place'] === 'continent') && zoom >= 2 && zoom <= 3)) {
1556 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1557 | s_default['text-offset'] = -10;
1558 | s_default['font-size'] = '8';
1559 | s_default['font-family'] = 'DejaVu Sans ExtraLight';
1560 | s_default['text-halo-radius'] = 1;
1561 | s_default['text-color'] = '#202020';
1562 | s_default['text-halo-color'] = '#ffffff';
1563 | s_default['z-index'] = -1;
1564 | s_default['-x-mapnik-min-distance'] = '0';
1565 | }
1566 |
1567 | if (((type === 'node' && tags['place'] === 'ocean') && zoom <= 6)) {
1568 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1569 | s_default['text-offset'] = 0;
1570 | s_default['font-size'] = '8';
1571 | s_default['font-family'] = 'DejaVu Sans Oblique';
1572 | s_default['text-halo-radius'] = 1;
1573 | s_default['text-color'] = '#202020';
1574 | s_default['text-halo-color'] = '#ffffff';
1575 | s_default['z-index'] = -1;
1576 | s_default['-x-mapnik-min-distance'] = '0';
1577 | }
1578 |
1579 | if (((type === 'node' && tags['place'] === 'ocean') && zoom >= 7)) {
1580 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1581 | s_default['text-offset'] = 0;
1582 | s_default['font-size'] = '11';
1583 | s_default['font-family'] = 'DejaVu Sans Oblique';
1584 | s_default['text-halo-radius'] = 1;
1585 | s_default['text-color'] = '#202020';
1586 | s_default['text-halo-color'] = '#ffffff';
1587 | s_default['z-index'] = -1;
1588 | s_default['-x-mapnik-min-distance'] = '0';
1589 | }
1590 |
1591 | if (((type === 'node' && tags['place'] === 'sea') && zoom <= 6)) {
1592 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1593 | s_default['text-offset'] = 0;
1594 | s_default['font-size'] = '8';
1595 | s_default['font-family'] = 'DejaVu Sans Oblique';
1596 | s_default['text-halo-radius'] = 1;
1597 | s_default['text-color'] = '#4976d1';
1598 | s_default['text-halo-color'] = '#ffffff';
1599 | s_default['-x-mapnik-min-distance'] = '0';
1600 | }
1601 |
1602 | if (((type === 'node' && tags['place'] === 'sea') && zoom >= 7)) {
1603 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1604 | s_default['text-offset'] = 0;
1605 | s_default['font-size'] = '10';
1606 | s_default['font-family'] = 'DejaVu Sans Oblique';
1607 | s_default['text-halo-radius'] = 1;
1608 | s_default['text-color'] = '#4976d1';
1609 | s_default['text-halo-color'] = '#ffffff';
1610 | s_default['-x-mapnik-min-distance'] = '0';
1611 | }
1612 |
1613 | if (((type === 'node' && tags['natural'] === 'peak' && tags['ele'] > '4500') && zoom >= 3 && zoom <= 4)) {
1614 | s_default['icon-image'] = 'mountain_peak6.png';
1615 | s_default['text'] = MapCSS.e_localize(tags, 'ele');
1616 | s_default['text-offset'] = 3;
1617 | s_default['font-size'] = '7';
1618 | s_default['font-family'] = 'DejaVu Sans Mono Book';
1619 | s_default['text-halo-radius'] = 0;
1620 | s_default['text-color'] = '#664229';
1621 | s_default['text-halo-color'] = '#ffffff';
1622 | s_default['-x-mapnik-min-distance'] = '0';
1623 | }
1624 |
1625 | if (((type === 'node' && tags['natural'] === 'peak' && tags['ele'] > '3500') && zoom >= 5 && zoom <= 6)) {
1626 | s_default['icon-image'] = 'mountain_peak6.png';
1627 | s_default['text'] = MapCSS.e_localize(tags, 'ele');
1628 | s_default['text-offset'] = 3;
1629 | s_default['font-size'] = '7';
1630 | s_default['font-family'] = 'DejaVu Sans Mono Book';
1631 | s_default['text-halo-radius'] = 0;
1632 | s_default['text-color'] = '#664229';
1633 | s_default['text-halo-color'] = '#ffffff';
1634 | s_default['-x-mapnik-min-distance'] = '0';
1635 | }
1636 |
1637 | if (((type === 'node' && tags['natural'] === 'peak' && tags['ele'] > '2500') && zoom >= 7 && zoom <= 12)) {
1638 | s_default['icon-image'] = 'mountain_peak6.png';
1639 | s_default['text'] = MapCSS.e_localize(tags, 'ele');
1640 | s_default['text-offset'] = 3;
1641 | s_default['font-size'] = '7';
1642 | s_default['font-family'] = 'DejaVu Sans Mono Book';
1643 | s_default['text-halo-radius'] = 0;
1644 | s_default['text-color'] = '#664229';
1645 | s_default['text-halo-color'] = '#ffffff';
1646 | s_default['-x-mapnik-min-distance'] = '0';
1647 | }
1648 |
1649 | if (((type === 'node' && tags['natural'] === 'peak') && zoom >= 12)) {
1650 | s_default['icon-image'] = 'mountain_peak6.png';
1651 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1652 | s_default['text-offset'] = 3;
1653 | s_default['font-size'] = '7';
1654 | s_default['font-family'] = 'DejaVu Sans Mono Book';
1655 | s_default['text-halo-radius'] = 0;
1656 | s_default['text-color'] = '#664229';
1657 | s_default['text-halo-color'] = '#ffffff';
1658 | s_default['-x-mapnik-min-distance'] = '0';
1659 | }
1660 |
1661 | if (((type === 'node' && tags['place'] === 'country') && zoom >= 2 && zoom <= 3)) {
1662 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1663 | s_default['text-offset'] = 0;
1664 | s_default['font-size'] = '10';
1665 | s_default['font-family'] = 'DejaVu Sans Book';
1666 | s_default['text-halo-radius'] = 1;
1667 | s_default['text-color'] = '#dd5875';
1668 | s_default['text-halo-color'] = '#ffffff';
1669 | s_default['z-index'] = 1;
1670 | s_default['-x-mapnik-min-distance'] = '0';
1671 | }
1672 |
1673 | if (((type === 'node' && tags['place'] === 'country') && zoom >= 4 && zoom <= 8)) {
1674 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1675 | s_default['text-offset'] = 0;
1676 | s_default['font-size'] = '13';
1677 | s_default['font-family'] = 'DejaVu Sans Book';
1678 | s_default['text-halo-radius'] = 1;
1679 | s_default['text-color'] = 'red';
1680 | s_default['text-halo-color'] = '#ffffff';
1681 | s_default['z-index'] = 1;
1682 | s_default['-x-mapnik-min-distance'] = '0';
1683 | }
1684 |
1685 | if (((type === 'node' && tags['place'] === 'country') && zoom >= 8 && zoom <= 10)) {
1686 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1687 | s_default['text-offset'] = 0;
1688 | s_default['font-size'] = '16';
1689 | s_default['font-family'] = 'DejaVu Sans Book';
1690 | s_default['text-halo-radius'] = 1;
1691 | s_default['text-color'] = 'red';
1692 | s_default['text-halo-color'] = '#ffffff';
1693 | s_default['z-index'] = 1;
1694 | s_default['-x-mapnik-min-distance'] = '0';
1695 | }
1696 |
1697 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '3') && zoom >= 3 && zoom <= 5)) {
1698 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1699 | s_default['text-offset'] = -5;
1700 | s_default['font-size'] = '8';
1701 | s_default['font-family'] = 'DejaVu Sans ExtraLight';
1702 | s_default['text-halo-radius'] = 0;
1703 | s_default['text-color'] = '#101010';
1704 | s_default['text-halo-color'] = '#ffffff';
1705 | s_default['-x-mapnik-min-distance'] = '0';
1706 | s_default['max-width'] = 50;
1707 | }
1708 |
1709 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '4') && zoom >= 6 && zoom <= 10)) {
1710 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1711 | s_default['text-offset'] = 17;
1712 | s_default['font-size'] = '14';
1713 | s_default['font-family'] = 'DejaVu Sans ExtraLight';
1714 | s_default['text-halo-radius'] = 1;
1715 | s_default['text-color'] = '#606060';
1716 | s_default['text-halo-color'] = '#ffffff';
1717 | s_default['-x-mapnik-min-distance'] = '0';
1718 | }
1719 |
1720 | if (((selector === 'area' && tags['boundary'] === 'administrative' && tags['admin_level'] === '6') && zoom >= 10)) {
1721 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1722 | s_default['text-offset'] = -10;
1723 | s_default['font-size'] = '12';
1724 | s_default['font-family'] = 'DejaVu Sans ExtraLight';
1725 | s_default['text-halo-radius'] = 1;
1726 | s_default['text-color'] = '#7848a0';
1727 | s_default['text-halo-color'] = '#ffffff';
1728 | }
1729 |
1730 | if (((type === 'node' && tags['place'] === 'suburb') && zoom >= 12)) {
1731 | s_default['text'] = MapCSS.e_localize(tags, 'name');
1732 | s_default['font-size'] = '12';
1733 | s_default['font-family'] = 'DejaVu Sans ExtraLight';
1734 | s_default['text-color'] = '#7848a0';
1735 | s_default['z-index'] = 20;
1736 | }
1737 |
1738 | if (((selector === 'area' && (tags.hasOwnProperty('building'))) && zoom >= 13)) {
1739 | s_default['width'] = 0.3;
1740 | s_default['color'] = '#cca352';
1741 | s_default['z-index'] = 17;
1742 | }
1743 |
1744 | if (((selector === 'area' && (tags['building'] === '1' || tags['building'] === 'true' || tags['building'] === 'yes')) && zoom >= 15)) {
1745 | s_default['fill-color'] = '#E7CCB4';
1746 | s_default['z-index'] = 17;
1747 | }
1748 |
1749 | if (((selector === 'area' && tags['building'] === 'public') && zoom >= 15)) {
1750 | s_default['fill-color'] = '#edc2ba';
1751 | s_default['z-index'] = 17;
1752 | }
1753 |
1754 | if (((selector === 'area' && (tags.hasOwnProperty('building')) && (tags['building '] === '-1' || tags['building '] === 'false' || tags['building '] === 'no') && tags['building'] !== 'public') && zoom >= 15)) {
1755 | s_default['fill-color'] = '#D8D1D1';
1756 | s_default['z-index'] = 17;
1757 | }
1758 |
1759 | if (((selector === 'area' && (tags.hasOwnProperty('building'))) && zoom >= 15 && zoom <= 16)) {
1760 | s_default['text'] = MapCSS.e_localize(tags, 'addr:housenumber');
1761 | s_default['text-halo-radius'] = 1;
1762 | s_default['text-position'] = 'center';
1763 | s_default['font-size'] = '7';
1764 | s_default['-x-mapnik-min-distance'] = '10';
1765 | s_default['opacity'] = 0.8;
1766 | }
1767 |
1768 | if (((selector === 'area' && (tags.hasOwnProperty('building'))) && zoom >= 17)) {
1769 | s_default['text'] = MapCSS.e_localize(tags, 'addr:housenumber');
1770 | s_default['text-halo-radius'] = 1;
1771 | s_default['text-position'] = 'center';
1772 | s_default['font-size'] = '8';
1773 | s_default['-x-mapnik-min-distance'] = '10';
1774 | s_default['opacity'] = 0.8;
1775 | }
1776 |
1777 | if (((type === 'node' && tags['highway'] === 'milestone' && (tags.hasOwnProperty('pk'))) && zoom >= 13)) {
1778 | s_default['text'] = MapCSS.e_localize(tags, 'pk');
1779 | s_default['font-size'] = '7';
1780 | s_default['text-halo-radius'] = 5;
1781 | s_default['-x-mapnik-min-distance'] = '0';
1782 | }
1783 |
1784 | if (Object.keys(s_default).length) {
1785 | style['default'] = s_default;
1786 | }
1787 | if (Object.keys(s_centerline).length) {
1788 | style['centerline'] = s_centerline;
1789 | }
1790 | if (Object.keys(s_ticks).length) {
1791 | style['ticks'] = s_ticks;
1792 | }
1793 | if (Object.keys(s_label).length) {
1794 | style['label'] = s_label;
1795 | }
1796 | return style;
1797 | }
1798 |
1799 | var sprite_images = {
1800 | 'adm1_4_6.png': {
1801 | width: 4,
1802 | height: 4,
1803 | offset: 0
1804 | },
1805 | 'adm1_5.png': {
1806 | width: 5,
1807 | height: 5,
1808 | offset: 4
1809 | },
1810 | 'adm1_6_test2.png': {
1811 | width: 6,
1812 | height: 6,
1813 | offset: 9
1814 | },
1815 | 'adm_4.png': {
1816 | width: 4,
1817 | height: 4,
1818 | offset: 15
1819 | },
1820 | 'adm_5.png': {
1821 | width: 5,
1822 | height: 5,
1823 | offset: 19
1824 | },
1825 | 'adm_6.png': {
1826 | width: 6,
1827 | height: 6,
1828 | offset: 24
1829 | },
1830 | 'airport_world.png': {
1831 | width: 11,
1832 | height: 14,
1833 | offset: 30
1834 | },
1835 | 'aut2_16x16_park.png': {
1836 | width: 16,
1837 | height: 16,
1838 | offset: 44
1839 | },
1840 | 'autobus_stop_14x10.png': {
1841 | width: 14,
1842 | height: 10,
1843 | offset: 60
1844 | },
1845 | 'bull2.png': {
1846 | width: 12,
1847 | height: 12,
1848 | offset: 70
1849 | },
1850 | 'cemetry7_2.png': {
1851 | width: 14,
1852 | height: 14,
1853 | offset: 82
1854 | },
1855 | 'cinema_14x14.png': {
1856 | width: 14,
1857 | height: 14,
1858 | offset: 96
1859 | },
1860 | 'desert22.png': {
1861 | width: 16,
1862 | height: 8,
1863 | offset: 110
1864 | },
1865 | 'glacier.png': {
1866 | width: 10,
1867 | height: 10,
1868 | offset: 118
1869 | },
1870 | 'hotell_14x14.png': {
1871 | width: 14,
1872 | height: 14,
1873 | offset: 128
1874 | },
1875 | 'kindergarten_14x14.png': {
1876 | width: 14,
1877 | height: 14,
1878 | offset: 142
1879 | },
1880 | 'kust1.png': {
1881 | width: 14,
1882 | height: 14,
1883 | offset: 156
1884 | },
1885 | 'lib_13x14.png': {
1886 | width: 13,
1887 | height: 12,
1888 | offset: 170
1889 | },
1890 | 'med1_11x14.png': {
1891 | width: 11,
1892 | height: 14,
1893 | offset: 182
1894 | },
1895 | 'metro_others6.png': {
1896 | width: 16,
1897 | height: 16,
1898 | offset: 196
1899 | },
1900 | 'mountain_peak6.png': {
1901 | width: 3,
1902 | height: 3,
1903 | offset: 212
1904 | },
1905 | 'mus_13x12.png': {
1906 | width: 13,
1907 | height: 12,
1908 | offset: 215
1909 | },
1910 | 'parks2.png': {
1911 | width: 12,
1912 | height: 12,
1913 | offset: 227
1914 | },
1915 | 'post_14x11.png': {
1916 | width: 14,
1917 | height: 11,
1918 | offset: 239
1919 | },
1920 | 'pravosl_kupol_11x15.png': {
1921 | width: 11,
1922 | height: 15,
1923 | offset: 250
1924 | },
1925 | 'rest_14x14.png': {
1926 | width: 14,
1927 | height: 14,
1928 | offset: 265
1929 | },
1930 | 'rw_stat_stanzii_2_blue.png': {
1931 | width: 9,
1932 | height: 5,
1933 | offset: 279
1934 | },
1935 | 'sady10.png': {
1936 | width: 16,
1937 | height: 16,
1938 | offset: 284
1939 | },
1940 | 'school_13x13.png': {
1941 | width: 13,
1942 | height: 13,
1943 | offset: 300
1944 | },
1945 | 'sud_14x13.png': {
1946 | width: 14,
1947 | height: 13,
1948 | offset: 313
1949 | },
1950 | 'superm_12x12.png': {
1951 | width: 12,
1952 | height: 12,
1953 | offset: 326
1954 | },
1955 | 'swamp_world2.png': {
1956 | width: 23,
1957 | height: 24,
1958 | offset: 338
1959 | },
1960 | 'tankstelle1_10x11.png': {
1961 | width: 10,
1962 | height: 11,
1963 | offset: 362
1964 | },
1965 | 'teater_14x14.png': {
1966 | width: 14,
1967 | height: 14,
1968 | offset: 373
1969 | },
1970 | 'town_4.png': {
1971 | width: 4,
1972 | height: 4,
1973 | offset: 387
1974 | },
1975 | 'town_6.png': {
1976 | width: 6,
1977 | height: 6,
1978 | offset: 391
1979 | },
1980 | 'tramway_14x13.png': {
1981 | width: 14,
1982 | height: 13,
1983 | offset: 397
1984 | },
1985 | 'univer_15x11.png': {
1986 | width: 15,
1987 | height: 11,
1988 | offset: 410
1989 | },
1990 | 'wc-3_13x13.png': {
1991 | width: 13,
1992 | height: 13,
1993 | offset: 421
1994 | },
1995 | 'zoo4_14x14.png': {
1996 | width: 14,
1997 | height: 14,
1998 | offset: 434
1999 | }
2000 | }, external_images = [], presence_tags = ['shop'], value_tags = ['color', 'amenity', 'pk', 'building ', 'marking', 'service', 'addr:housenumber', 'population', 'leisure', 'waterway', 'aeroway', 'landuse', 'barrier', 'colour', 'railway', 'oneway', 'religion', 'tourism', 'admin_level', 'transport', 'name', 'building', 'place', 'residential', 'highway', 'ele', 'living_street', 'natural', 'boundary', 'capital'];
2001 |
2002 | MapCSS.loadStyle('osmosnimki', restyle, sprite_images, external_images, presence_tags, value_tags);
2003 | MapCSS.preloadExternalImages('osmosnimki');
2004 | })(MapCSS);
2005 |
2006 |
--------------------------------------------------------------------------------
/debug/styles/osmosnimki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kothic/kothic-js/4edc827f5f59b680ce2c6936d98d8b8283b6620e/debug/styles/osmosnimki.png
--------------------------------------------------------------------------------
/debug/styles/surface.js:
--------------------------------------------------------------------------------
1 |
2 | (function (MapCSS) {
3 | 'use strict';
4 |
5 | function restyle(style, tags, zoom, type, selector) {
6 | var s_default = {}, s_overlay = {};
7 |
8 | if (((type == 'way' && tags['highway'] == 'primary' && (!tags.hasOwnProperty('surface'))))) {
9 | s_overlay['color'] = '#f00';
10 | s_overlay['width'] = 1;
11 | s_overlay['z-index'] = 100;
12 | }
13 |
14 | if (Object.keys(s_default).length) {
15 | style['default'] = s_default;
16 | }
17 | if (Object.keys(s_overlay).length) {
18 | style['overlay'] = s_overlay;
19 | }
20 | return style;
21 | }
22 |
23 | var sprite_images = {
24 | }, external_images = [], presence_tags = ['surface'], value_tags = ['highway'];
25 |
26 | MapCSS.loadStyle('surface', restyle, sprite_images, external_images, presence_tags, value_tags);
27 | MapCSS.preloadExternalImages('surface');
28 | })(MapCSS);
29 |
30 |
--------------------------------------------------------------------------------
/debug/tile.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Kothic JS tile test
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/dist/kothic-leaflet.js:
--------------------------------------------------------------------------------
1 | L.TileLayer.Kothic = L.GridLayer.extend({
2 | options: {
3 | tileSize: 256,
4 | zoomOffset: 0,
5 | minZoom: 2,
6 | maxZoom: 22,
7 | updateWhenIdle: true,
8 | unloadInvisibleTiles: true,
9 | attribution: 'Map data © 2019 OpenStreetMap contributors,' +
10 | ' Rendering by Kothic JS',
11 | async: true,
12 | buffered: false,
13 | styles: MapCSS.availableStyles
14 | },
15 |
16 | initialize: function(url,options) {
17 | L.Util.setOptions(this, options);
18 |
19 | this._url = url;
20 | this._canvases = {};
21 | this._debugMessages = [];
22 |
23 | window.onKothicDataResponse = L.Util.bind(this._onKothicDataResponse, this);
24 | },
25 |
26 | _onKothicDataResponse: function(data, zoom, x, y, done) {
27 | var error;
28 | var key = [zoom, x, y].join('/'),
29 | canvas = this._canvases[key],
30 | zoomOffset = this.options.zoomOffset;
31 |
32 | if (!canvas) {
33 | return;
34 | }
35 |
36 | function onRenderComplete() {
37 | done(error, canvas);
38 | }
39 |
40 | this._invertYAxe(data);
41 |
42 | var styles = this.options.styles;
43 |
44 | Kothic.render(canvas, data, zoom + zoomOffset, {
45 | styles: styles,
46 | locales: ['be', 'ru', 'en'],
47 | onRenderComplete: onRenderComplete
48 | });
49 |
50 | delete this._canvases[key];
51 | },
52 |
53 | getDebugMessages: function() {
54 | return this._debugMessages;
55 | },
56 |
57 | createTile: function(tilePoint, done) {
58 | // create a