File tree Expand file tree Collapse file tree
Samples/Controls/Map Navigation Control Options Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 }
4040
4141 //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.
42- //authType: 'subscriptionKey',
43- //subscriptionKey: '[YOUR_AZURE_MAPS_KEY]'
42+ // authType: 'subscriptionKey',
43+ // subscriptionKey: '[YOUR_AZURE_MAPS_KEY]'
4444 }
4545 } ) ;
4646
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+
95102 //Add controls to the map.
96103 map . controls . add ( controls , {
97104 position : positionOption
106113 < style >
107114 . sidePanel {
108115 width : 350px ;
109- height : 580 px ;
116+ height : 640 px ;
110117 float : left;
111118 margin-right : 10px ;
112119 }
224231 </ select >
225232 </ td >
226233 </ 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 >
227257 </ table >
228258 </ div >
229259
You can’t perform that action at this time.
0 commit comments