Skip to content

Commit e17d8bb

Browse files
author
Savina Shen (Manpower Services Taiwan Co Ltd)
committed
add scale, fullscreen control samples
1 parent 74ee442 commit e17d8bb

3 files changed

Lines changed: 75 additions & 100 deletions

File tree

‎Samples/Controls/Fullscreen control options/Fullscreen control options.html‎

Lines changed: 71 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -77,71 +77,80 @@
7777
}
7878
</script>
7979
<style>
80-
.testContainer {
81-
background-color: white;
82-
}
83-
84-
.sidePanel {
85-
width: 325px;
86-
height: 580px;
87-
float: left;
88-
margin-right: 10px;
89-
}
90-
91-
#myMap {
92-
position: relative;
93-
width: calc(100% - 375px);
94-
min-width: 290px;
95-
height: 600px;
96-
float: left;
97-
}
98-
99-
#eventInfo {
100-
width: 300px;
101-
height: 420px;
102-
overflow-y: auto;
103-
}
104-
80+
.testContainer {
81+
background-color: white;
82+
}
83+
84+
.sidePanel {
85+
width: 325px;
86+
height: 580px;
87+
float: left;
88+
margin-right: 10px;
89+
}
90+
91+
#myMap {
92+
position: relative;
93+
width: calc(100% - 375px);
94+
min-width: 290px;
95+
height: 600px;
96+
float: left;
97+
}
10598
</style>
106-
</head>
107-
<body onload="getMap()">
108-
99+
</head>
100+
<body onload="getMap()">
109101
<div class="testContainer">
110-
<fieldset class="sidePanel">
111-
<legend>Fullscreen control options</legend>
112-
This sample shows how to create a fullscreen control and all of its options.
113-
<br /><br />
114-
115-
<div id="Options" class="tabcontent" style="display:block;">
116-
<table>
117-
<tr title="The HTML element that should be made fullscreen.">
118-
<td>Container:</td>
119-
<td>
120-
<select id="container" onchange="addFullscreenControl()" title="Container">
121-
<option>HTML element</option>
122-
<option selected="selected">map</option>
123-
</select>
124-
</td>
125-
</tr>
126-
<tr title="Specifies if the control should be hidden if fullscreen is not supported by the browser. ">
127-
<td>Hide if unsupported:</td>
128-
<td><input id="hideIfUnsupported" title="Hide if unsupported" type="checkbox" checked="checked" onclick="update()" /></td>
129-
</tr>
130-
<tr title="The style of the control.">
131-
<td>Style:</td>
132-
<td>
133-
<select id="style" onchange="addFullscreenControl()" title="Style">
134-
<option>auto</option>
135-
<option>dark</option>
136-
<option selected="selected">light</option>
137-
</select>
138-
</td>
139-
</tr>
140-
</table>
141-
</div>
102+
<div class="sidePanel">
103+
<fieldset style="width: 320px; margin-bottom: 10px">
104+
<legend>Fullscreen control options</legend>
105+
This sample shows how to create a fullscreen control and all of its
106+
options.
142107
</fieldset>
143-
144-
<div id="myMap"></div>
108+
<table>
109+
<tr title="The HTML element that should be made fullscreen.">
110+
<td>Container:</td>
111+
<td>
112+
<select
113+
id="container"
114+
onchange="addFullscreenControl()"
115+
title="Container"
116+
>
117+
<option>HTML element</option>
118+
<option selected="selected">map</option>
119+
</select>
120+
</td>
121+
</tr>
122+
<tr
123+
title="Specifies if the control should be hidden if fullscreen is not supported by the browser. "
124+
>
125+
<td>Hide if unsupported:</td>
126+
<td>
127+
<input
128+
id="hideIfUnsupported"
129+
title="Hide if unsupported"
130+
type="checkbox"
131+
checked="checked"
132+
onclick="addFullscreenControl()"
133+
/>
134+
</td>
135+
</tr>
136+
<tr title="The style of the control.">
137+
<td>Style:</td>
138+
<td>
139+
<select
140+
id="style"
141+
onchange="addFullscreenControl()"
142+
title="Style"
143+
>
144+
<option>auto</option>
145+
<option>dark</option>
146+
<option selected="selected">light</option>
147+
</select>
148+
</td>
149+
</tr>
150+
</table>
151+
</div>
152+
153+
<div id="myMap"></div>
145154
</div>
146155
</body>
147156
</html>

‎Samples/Controls/Map Navigation Control Options/Map Navigation Control Options.html‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,6 @@
9292
layout: pickerLayout
9393
}));
9494

95-
//Create a scale control and add it to the map.
96-
controls.push(new atlas.control.ScaleControl({
97-
maxWidth: parseFloat(getSelectValue('scaleMaxWidth')),
98-
unit: getSelectValue('scaleUnit'),
99-
style: controlStyle
100-
}));
101-
10295
//Add controls to the map.
10396
map.controls.add(controls, {
10497
position: positionOption
@@ -231,29 +224,6 @@
231224
</select>
232225
</td>
233226
</tr>
234-
235-
<tr title="The maximum length of the scale control in pixels.">
236-
<td>Scale Max Width:</td>
237-
<td>
238-
<select id="scaleMaxWidth" onchange="addControls()" title="Scale Max Width">
239-
<option>50</option>
240-
<option selected="selected">100</option>
241-
<option>200</option>
242-
<option>400</option>
243-
</select>
244-
</td>
245-
</tr>
246-
247-
<tr title="The unit of the distance shown on scale control.">
248-
<td>Scale Unit:</td>
249-
<td>
250-
<select id="scaleUnit" onchange="addControls()" title="Scale Unit">
251-
<option>imperial</option>
252-
<option selected="selected">metric</option>
253-
<option>nautical</option>
254-
</select>
255-
</td>
256-
</tr>
257227
</table>
258228
</div>
259229

‎Samples/Controls/Simple Scale Bar Control/Simple Scale Bar Control.html‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
<link href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css" rel="stylesheet" />
1717
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js"></script>
1818

19-
<!-- Add reference to the scale bar control module. -->
20-
<script src="/lib/azure-maps/azure-maps-scale-bar-control.min.js"></script>
21-
2219
<script>
2320
var map;
2421

@@ -51,12 +48,12 @@
5148
//Add controls to the map.
5249
map.controls.add([
5350
//Add a imperial scale bar to the map.
54-
new atlas.control.ScaleBarControl({
51+
new atlas.control.ScaleControl({
5552
units: 'imperial'
5653
}),
5754

5855
//Add a metric scale bar to the map.
59-
new atlas.control.ScaleBarControl({
56+
new atlas.control.ScaleControl({
6057
units: 'metric'
6158
})], {
6259
position: 'bottom-left'
@@ -69,9 +66,8 @@
6966
<div id="myMap" style="position:relative;width:100%;min-width:290px;height:600px;"></div>
7067

7168
<fieldset style="width:calc(100% - 30px);min-width:290px;margin-top:10px;">
72-
<legend>Simple Scale Bar Control</legend>
73-
This sample shows how to create a simple scale bar control that can be added to the map. This sample is loading two scale bars, one with units set to imperial and the other to metric.
74-
This samples uses the open source <a href="https://github.com/Azure-Samples/azure-maps-scale-bar-control" target="_blank">Azure Maps Scale Bar Control module</a>.
69+
<legend>Scale Control</legend>
70+
This sample shows how to create a scale bar control that can be added to the map. This sample is loading two scale bars, one with units set to imperial and the other to metric.
7571
</fieldset>
7672
</body>
7773
</html>

0 commit comments

Comments
 (0)