-
Notifications
You must be signed in to change notification settings - Fork 471
Expand file tree
/
Copy pathSymbol Layer Options.html
More file actions
596 lines (550 loc) · 32.8 KB
/
Symbol Layer Options.html
File metadata and controls
596 lines (550 loc) · 32.8 KB
1
2
3
4
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
<!DOCTYPE html>
<html lang="en">
<head>
<title>Symbol Layer Options - Azure Maps Web SDK Samples</title>
<meta charset="utf-8" />
<link rel="shortcut icon" href="/favicon.ico"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="This sample shows how the different options of the symbol layer affect rendering." />
<meta name="keywords" content="Microsoft maps, map, gis, API, SDK, symbols, markers, pins, pushpins, layer" />
<meta name="author" content="Microsoft Azure Maps" /><meta name="version" content="1.0" />
<meta name="screenshot" content="screenshot.jpg" />
<!-- Add references to the Azure Maps Map control JavaScript and CSS files. -->
<link href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css" rel="stylesheet" />
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js"></script>
<script src="/lib/clipboard/dist/clipboard.min.js"></script>
<script>
var map, datasource, symbolLayer, testDataSize = 100, defaultOptions, removeDefaults;
function getMap() {
//Initialize a map instance.
map = new atlas.Map('myMap', {
view: 'Auto',
language: 'Auto',
//Add authentication details for connecting to Azure Maps.
authOptions: {
// Use SAS token for authentication
authType: 'sas',
getToken: function (resolve, reject, map) {
// URL to your authentication service that retrieves a SAS Token
var tokenServiceUrl = 'https://samples.azuremaps.com/api/GetAzureMapsSasToken';
fetch(tokenServiceUrl).then(r => r.text()).then(token => resolve(token));
}
//Alternatively, use an Azure Maps key. Get an Azure Maps key at https://azure.com/maps. NOTE: The primary key should be used as the key.
//authType: 'subscriptionKey',
//subscriptionKey: '[YOUR_AZURE_MAPS_KEY]'
}
});
//Wait until the map resources are ready.
map.events.add('ready', function () {
//Create a style control and add it to the map.
map.controls.add(new atlas.control.StyleControl({
style: 'dark'
}), {
position: 'top-right'
});
//Create a data source and add it to the map.
datasource = new atlas.source.DataSource();
map.sources.add(datasource);
//Add random point features to data source.
datasource.add(generateRandomPoints(testDataSize));
//Create a layer to render the point data.
symbolLayer = new atlas.layer.SymbolLayer(datasource);
map.layers.add(symbolLayer);
defaultOptions = symbolLayer.getOptions();
defaultOptions.textOptions.haloColor = '#000000'; //Default is actually rgba(0,0,0,0)
//Update the symbol layer with the options in the input fields.
updateSymbolLayer();
});
new ClipboardJS('.copyBtn');
}
function updateSymbolLayer() {
var options = getInputOptions();
//Update all the options in the symbol layer.
symbolLayer.setOptions(options);
document.getElementById('CodeOutput').value = JSON.stringify(options, null, '\t').replace(/\"([^(\")"]+)\":/g, "$1:");
}
function getInputOptions() {
removeDefaults = document.getElementById('RemoveDefaults').checked;
return {
iconOptions: {
image: getPropertyValue('iconOptions.image', getSelectValue('Icon')),
size: getPropertyValue('iconOptions.size', parseFloat(document.getElementById('IconSize').value)),
anchor: getPropertyValue('iconOptions.anchor', getSelectValue('IconAnchor')),
offset: getPropertyValue('iconOptions.offset', [
parseFloat(document.getElementById('IconOffsetX').value),
parseFloat(document.getElementById('IconOffsetY').value)
]),
rotation: getPropertyValue('iconOptions.rotation', parseFloat(document.getElementById('IconRotation').value)),
rotationAlignment: getPropertyValue('iconOptions.rotationAlignment', getSelectValue('IconRotationAlignment')),
opacity: getPropertyValue('iconOptions.opacity', parseFloat(document.getElementById('IconOpacity').value)),
allowOverlap: getPropertyValue('iconOptions.allowOverlap', document.getElementById('IconAllowOverlap').checked),
ignorePlacement: getPropertyValue('iconOptions.ignorePlacement', document.getElementById('IgnoreIconPlacement').checked),
optional: getPropertyValue('iconOptions.optional', document.getElementById('IconOptional').checked),
pitchAlignment: getPropertyValue('iconOptions.pitchAlignment', document.getElementById('IconPitchAlignment').value)
},
textOptions: {
allowOverlap: getPropertyValue('textOptions.allowOverlap', document.getElementById('TextAllowOverlap').checked),
anchor: getPropertyValue('textOptions.anchor', getSelectValue('TextAnchor')),
color: getPropertyValue('textOptions.color', document.getElementById('FontColor').value),
font: getPropertyValue('textOptions.font', [getSelectValue('TextFont')]),
ignorePlacement: getPropertyValue('textOptions.ignorePlacement', document.getElementById('IgnoreTextPlacement').checked),
haloBlur: getPropertyValue('textOptions.haloBlur', parseFloat(document.getElementById('HaloBlur').value)),
haloColor: getPropertyValue('textOptions.haloColor', document.getElementById('HaloColor').value),
haloWidth: getPropertyValue('textOptions.haloWidth', parseFloat(document.getElementById('HaloWidth').value)),
offset: getPropertyValue('textOptions.offset', [
parseFloat(document.getElementById('TextOffsetX').value),
parseFloat(document.getElementById('TextOffsetY').value)
]),
opacity: getPropertyValue('textOptions.opacity', parseFloat(document.getElementById('TextOpacity').value)),
optional: getPropertyValue('textOptions.optional', document.getElementById('TextOptional').checked),
size: getPropertyValue('textOptions.size', parseFloat(document.getElementById('FontSize').value)),
textField: ['get', 'title'],
pitchAlignment: getPropertyValue('iconOptions.pitchAlignment', document.getElementById('TextPitchAlignment').value),
rotation: getPropertyValue('iconOptions.rotation', parseFloat(document.getElementById('TextRotation').value)),
rotationAlignment: getPropertyValue('iconOptions.rotationAlignment', getSelectValue('TextRotationAlignment'))
},
minZoom: getPropertyValue('minZoom', parseFloat(document.getElementById('MinZoom').value)),
maxZoom: getPropertyValue('maxZoom', parseFloat(document.getElementById('MaxZoom').value)),
visible: getPropertyValue('visible', document.getElementById('Visible').checked)
};
}
function getPropertyValue(propertyName, value) {
if (removeDefaults) {
if (propertyName.indexOf('.') > -1) {
var p = propertyName.split('.');
var val = defaultOptions;
for (var i = 0; i < p.length; i++) {
val = val[p[i]];
}
if (Array.isArray(value) && JSON.stringify(val) === JSON.stringify(value)) {
return undefined;
} else if (val === value) {
return undefined;
}
} else if (Array.isArray(value) && JSON.stringify(val) === JSON.stringify(value)) {
return undefined;
} else if (defaultOptions[propertyName] === value) {
return undefined;
}
}
return value;
}
function generateRandomPoints(cnt) {
var layerData = [];
for (var i = 0; i < cnt; i++) {
layerData.push(new atlas.data.Feature(new atlas.data.Point([Math.random() * 360 - 180, Math.random() * 170 - 85]), {
title: 'Pin_' + i
}));
}
return layerData;
}
function getSelectValue(id) {
var elm = document.getElementById(id);
return elm.options[elm.selectedIndex].value;
}
function openTab(elm, tabName) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById(tabName).style.display = "block";
elm.className += " active";
}
</script>
<style>
#myMap {
position: relative;
width: calc(100% - 375px);
min-width:290px;
height: 600px;
float: left;
}
.sidePanel {
width: 325px;
height: 580px;
float: left;
margin-right: 10px;
}
#CodeOutput {
width: 300px;
height: 360px;
overflow-y: auto;
}
.copyBtn {
float: right;
}
table td:nth-of-type(1) {
width: 120px;
}
table td:nth-of-type(2) {
width: 200px;
}
.tab {
overflow: hidden;
border: 1px solid #ccc;
background-color: #f1f1f1;
}
.tab button {
background-color: inherit;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 6px 8px;
transition: 0.3s;
font-size: 14px;
}
.tab button:hover {
background-color: #ddd;
}
.tab button.active {
background-color: #ccc;
}
.tabcontent {
display: none;
padding: 6px 12px;
border: 1px solid #ccc;
border-top: none;
height: 420px;
overflow-y: auto;
}
</style>
</head>
<body onload="getMap()">
<fieldset class="sidePanel">
<legend>Symbol Layer Options</legend>
This sample shows how the different options of the symbol layer affect rendering.
<br /><br />
<div class="tab">
<button class="tablinks active" onclick="openTab(this, 'BaseStyles')">Base Options</button>
<button class="tablinks" onclick="openTab(this, 'IconOptions')">Icon Options</button>
<button class="tablinks" onclick="openTab(this, 'TextOptions')">Text Options</button>
<button class="tablinks" onclick="openTab(this, 'Code')">Code</button>
</div>
<div id="BaseStyles" class="tabcontent" style="display:block;">
<table>
<tr title="An integer specifying the minimum zoom level to render the layer at.">
<td>Min Zoom:</td>
<td>
<form oninput="minz.value=MinZoom.value">
<input type="range" id="MinZoom" value="0" min="0" max="24" step="1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="minz" for="MinZoom">0</output>
</form>
</td>
</tr>
<tr title="An integer specifying the maximum zoom level to render the layer at.">
<td>Max Zoom:</td>
<td>
<form oninput="maxz.value=MaxZoom.value">
<input type="range" id="MaxZoom" value="24" min="0" max="24" step="1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="maxz" for="MaxZoom">24</output>
</form>
</td>
</tr>
<tr title="Specifies if the layer is visible or not.">
<td>Visible:</td>
<td><input id="Visible" type="checkbox" onclick="updateSymbolLayer()" checked="checked" /></td>
</tr>
</table>
<p>
In addition to the options in this tool, the SymbolLayer also has options for;
<ul>
<li>sourceLayer - used with VectorTileSource.</li>
<li>lineSpacing - spacing when rendered along a line.</li>
<li>placement - defines if symbol placed on point or along a line.</li>
<li>filter - used to filter data in layer.</li>
</ul>
Many options in this layer also support Expressions which are not demonstrated in this sample.
</p>
</div>
<div id="IconOptions" class="tabcontent">
<table>
<tr title="The name of the image in the map's image sprite to use for drawing the icon.">
<td>Image:</td>
<td>
<select id="Icon" onchange="updateSymbolLayer()">
<option value="marker-black">marker-black</option>
<option value="marker-blue" selected="selected">marker-blue</option>
<option value="marker-darkblue">marker-darkblue</option>
<option value="marker-red">marker-red</option>
<option value="marker-yellow">marker-yellow</option>
<option value="pin-darkblue">pin-darkblue</option>
<option value="pin-blue">pin-blue</option>
<option value="pin-red">pin-red</option>
<option value="pin-round-darkblue">pin-round-darkblue</option>
<option value="pin-round-blue">pin-round-blue</option>
<option value="pin-round-red">pin-round-red</option>
<option value="none">none</option>
</select>
</td>
</tr>
<tr title="Scales the original size of the icon by the provided factor.">
<td>Size:</td>
<td>
<form oninput="a.value=IconSize.value">
<input type="range" id="IconSize" value="1" min="0.1" max="2" step="0.1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="a" for="IconSize">1</output>
</form>
</td>
</tr>
<tr title="Specifies which part of the icon is placed closest to the icons anchor position on the map.">
<td>Anchor:</td>
<td>
<select id="IconAnchor" onchange="updateSymbolLayer()">
<option value="bottom" selected="selected">bottom</option>
<option value="bottom-left">bottom-left</option>
<option value="bottom-right">bottom-right</option>
<option value="center">center</option>
<option value="left">left</option>
<option value="right">right</option>
<option value="top">top</option>
<option value="top-left">top-left</option>
<option value="top-right">top-right</option>
</select>
</td>
</tr>
<tr title="Specifies an offset distance of the icon from its anchor in pixels. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of size to obtain the final offset in pixels. When combined with rotation the offset will be as if the rotated direction was up.">
<td>Offset:</td>
<td></td>
</tr>
<tr title="Specifies an offset distance of the icon from its anchor in pixels. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of size to obtain the final offset in pixels. When combined with rotation the offset will be as if the rotated direction was up.">
<td align="right">x:</td>
<td>
<form oninput="x.value=IconOffsetX.value">
<input type="range" id="IconOffsetX" value="0" min="-50" max="50" step="1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="x" for="IconOffsetX">0</output>
</form>
</td>
</tr>
<tr title="Specifies an offset distance of the icon from its anchor in pixels. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of size to obtain the final offset in pixels. When combined with rotation the offset will be as if the rotated direction was up.">
<td align="right">y:</td>
<td>
<form oninput="y.value=IconOffsetY.value">
<input type="range" id="IconOffsetY" value="0" min="-50" max="50" step="01" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="y" for="IconOffsetY">0</output>
</form>
</td>
</tr>
<tr title="The amount to rotate the icon image clockwise in degrees.">
<td>Rotation:</td>
<td>
<form oninput="r.value=IconRotation.value">
<input type="range" id="IconRotation" value="0" min="-360" max="360" step="1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="r" for="IconRotation">0</output>
</form>
</td>
</tr>
<tr title="Specifies the orientation of the icon image when the map is rotated.">
<td>Rotation Alignment:</td>
<td>
<select id="IconRotationAlignment" onchange="updateSymbolLayer()">
<option value="auto" selected="selected">auto</option>
<option value="map">map</option>
<option value="viewport">viewport</option>
</select>
</td>
</tr>
<tr title="Specifies the orientation of the icon image when map is pitched.">
<td>Pitch Alignment:</td>
<td>
<select id="IconPitchAlignment" onchange="updateSymbolLayer()">
<option value="auto" selected="selected">auto</option>
<option value="map">map</option>
<option value="viewport">viewport</option>
</select>
</td>
</tr>
<tr title="A number between 0 and 1 that indicates the opacity at which the icon will be drawn.">
<td>Opacity:</td>
<td>
<form oninput="io.value=IconOpacity.value">
<input type="range" id="IconOpacity" value="1" min="0" max="1" step="0.1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="io" for="IconOpacity">1</output>
</form>
</td>
</tr>
<tr title="Specifies if the symbol icon can overlay other symbols on the map. If `true` the icon will be visible even if it collides with other previously drawn symbols. Tip: Set this to true if animating an symbol to ensure smooth rendering.">
<td>Allow Overlap:</td>
<td><input id="IconAllowOverlap" type="checkbox" onclick="updateSymbolLayer()" /></td>
</tr>
<tr title="Specifies if other symbols can overlap this symbol. If true, other symbols can be visible even if they collide with the icon.">
<td>Ignore Placement:</td>
<td><input id="IgnoreIconPlacement" type="checkbox" onclick="updateSymbolLayer()" /></td>
</tr>
<tr title="Specifies if a symbols icon can be hidden but its text displayed if it is overlapped with another symbol. If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.">
<td>Optional:</td>
<td><input id="IconOptional" type="checkbox" onclick="updateSymbolLayer()" /></td>
</tr>
</table>
</div>
<div id="TextOptions" class="tabcontent">
<table>
<tr title="The font stack to use for displaying text.">
<td colspan="2">Font:</td>
</tr>
<tr title="The font stack to use for displaying text.">
<td colspan="2">
<select id="TextFont" onchange="updateSymbolLayer()">
<option value="SegoeFrutigerHelveticaMYingHei-Bold">SegoeFrutigerHelveticaMYingHei-Bold</option>
<option value="SegoeFrutigerHelveticaMYingHei-Medium">SegoeFrutigerHelveticaMYingHei-Medium</option>
<option value="SegoeFrutigerHelveticaMYingHei-Regular">SegoeFrutigerHelveticaMYingHei-Regular</option>
<option value="SegoeUi-Bold">SegoeUi-Bold</option>
<option value="SegoeUi-Light">SegoeUi-Light</option>
<option value="SegoeUi-Regular">SegoeUi-Regular</option>
<option value="SegoeUi-SemiBold">SegoeUi-SemiBold</option>
<option value="SegoeUi-SemiLight">SegoeUi-SemiLight</option>
<option value="SegoeUi-SymbolRegular">SegoeUi-SymbolRegular</option>
<option value="StandardCondensedSegoeUi-Black">StandardCondensedSegoeUi-Black</option>
<option value="StandardCondensedSegoeUi-Bold">StandardCondensedSegoeUi-Bold</option>
<option value="StandardCondensedSegoeUi-Light">StandardCondensedSegoeUi-Light</option>
<option value="StandardCondensedSegoeUi-Regular">StandardCondensedSegoeUi-Regular</option>
<option value="StandardFont-Black">StandardFont-Black</option>
<option value="StandardFont-Bold">StandardFont-Bold</option>
<option value="StandardFontCondensed-Black">StandardFontCondensed-Black</option>
<option value="StandardFontCondensed-Bold">StandardFontCondensed-Bold</option>
<option value="StandardFontCondensed-Light">StandardFontCondensed-Light</option>
<option value="StandardFontCondensed-Regular">StandardFontCondensed-Regular</option>
<option value="StandardFont-Light">StandardFont-Light</option>
<option value="StandardFont-Regular" selected="selected">StandardFont-Regular</option>
</select>
</td>
</tr>
<tr title="The color of the text.">
<td>Color:</td>
<td><input type="color" id="FontColor" onchange="updateSymbolLayer()" /></td>
</tr>
<tr title="A number between 0 and 1 that indicates the opacity at which the text will be drawn.">
<td>Opacity:</td>
<td>
<form oninput="to.value=TextOpacity.value">
<input type="range" id="TextOpacity" value="1" min="0" max="1" step="0.1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="to" for="TextOpacity">1</output>
</form>
</td>
</tr>
<tr title="The size of the font in pixels.">
<td>Size:</td>
<td>
<form oninput="b.value=FontSize.value">
<input type="range" id="FontSize" value="16" min="8" max="25" step="1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="b" for="FontSize">16</output>
</form>
</td>
</tr>
<tr title="Specifies which part of the icon is placed closest to the icons anchor position on the map.">
<td>Anchor:</td>
<td>
<select id="TextAnchor" onchange="updateSymbolLayer()">
<option value="bottom">bottom</option>
<option value="bottom-left">bottom-left</option>
<option value="bottom-right">bottom-right</option>
<option value="center" selected="selected">center</option>
<option value="left">left</option>
<option value="right">right</option>
<option value="top">top</option>
<option value="top-left">top-left</option>
<option value="top-right">top-right</option>
</select>
</td>
</tr>
<tr title="Specifies an offset distance of the icon from its anchor in ems. Positive values indicate right and down, while negative values indicate left and up.">
<td>Offset:</td>
<td></td>
</tr>
<tr title="Specifies an offset distance of the icon from its anchor in ems. Positive values indicate right and down, while negative values indicate left and up.">
<td align="right">x:</td>
<td>
<form oninput="x.value=TextOffsetX.value">
<input type="range" id="TextOffsetX" value="0" min="-5" max="5" step="0.1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="x" for="TextOffsetX">0</output>
</form>
</td>
</tr>
<tr title="Specifies an offset distance of the icon from its anchor in ems. Positive values indicate right and down, while negative values indicate left and up.">
<td align="right">y:</td>
<td>
<form oninput="y.value=TextOffsetY.value">
<input type="range" id="TextOffsetY" value="0" min="-5" max="5" step="0.1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="y" for="TextOffsetY">0</output>
</form>
</td>
</tr>
<tr title="The amount to rotate the text clockwise in degrees.">
<td>Rotation:</td>
<td>
<form oninput="r.value=TextRotation.value">
<input type="range" id="TextRotation" value="0" min="-360" max="360" step="1" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="r" for="TextRotation">0</output>
</form>
</td>
</tr>
<tr title="Specifies the orientation of the text when the map is rotated.">
<td>Rotation Alignment:</td>
<td>
<select id="TextRotationAlignment" onchange="updateSymbolLayer()">
<option value="auto" selected="selected">auto</option>
<option value="map">map</option>
<option value="viewport">viewport</option>
</select>
</td>
</tr>
<tr title="Specifies the orientation of the text when map is pitched.">
<td>Pitch Alignment:</td>
<td>
<select id="TextPitchAlignment" onchange="updateSymbolLayer()">
<option value="auto" selected="selected">auto</option>
<option value="map">map</option>
<option value="viewport">viewport</option>
</select>
</td>
</tr>
<tr title="The halo's fadeout distance towards the outside in pixels.">
<td>Halo Blur:</td>
<td>
<form oninput="b.value=HaloBlur.value">
<input type="range" id="HaloBlur" value="0" min="0" max="5" step="0.2" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="b" for="HaloBlur">0</output>
</form>
</td>
</tr>
<tr title="The color of the text's halo, which helps it stand out from backgrounds.">
<td>Halo Color:</td>
<td><input type="color" id="HaloColor" value="#000000" onchange="updateSymbolLayer()" /></td>
</tr>
<tr title="The distance of the halo to the font outline in pixels. The maximum text halo width is 1/4 of the font size.">
<td>Halo Width:</td>
<td>
<form oninput="b.value=HaloWidth.value">
<input type="range" id="HaloWidth" value="0" min="0" max="15" step="0.2" oninput="updateSymbolLayer()" onchange="updateSymbolLayer()" />
<output name="b" for="HaloWidth">0</output>
</form>
</td>
</tr>
<tr title="Specifies if the text will be visible if it collides with other symbols. If true, the text will be visible even if it collides with other previously drawn symbols.">
<td>Allow Overlap:</td>
<td><input id="TextAllowOverlap" type="checkbox" onclick="updateSymbolLayer()" /></td>
</tr>
<tr title="Specifies if the other symbols are allowed to collide with the text. If true, other symbols can be visible even if they collide with the text.">
<td>Ignore Placement:</td>
<td><input id="IgnoreTextPlacement" type="checkbox" onclick="updateSymbolLayer()" /></td>
</tr>
<tr title="Specifies if the text can be hidden if it is overlapped by another symbol. If true, icons will display without their corresponding text when the text collides wit other symbols and the icon does not.">
<td>Optional:</td>
<td><input id="TextOptional" type="checkbox" onclick="updateSymbolLayer()" /></td>
</tr>
</table>
</div>
<div id="Code" class="tabcontent">
<textarea id="CodeOutput"></textarea><br /><br />
<input id="RemoveDefaults" type="checkbox" onclick="updateSymbolLayer()" checked="checked" /> Remove defaults
<button class="copyBtn" data-clipboard-target="#CodeOutput">Copy to clipboard</button>
</div>
</fieldset>
<div id="myMap"></div>
</body>
</html>