|
4 | 4 | <title>Cardinal Spline Options - Azure Maps Web SDK Samples</title>
|
5 | 5 |
|
6 | 6 | <meta charset="utf-8" />
|
7 |
| - <link rel="shortcut icon" href="/favicon.ico"/> |
8 |
| - |
| 7 | + <link rel="shortcut icon" href="/favicon.ico" /> |
| 8 | + |
9 | 9 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
10 | 10 | <meta name="description" content="This sample provides a set of controls to test the various features of the Cardinal Spline calculation." />
|
11 | 11 | <meta name="keywords" content="Microsoft maps, map, gis, API, SDK, spatial math, math, spline, cardinal spline, curves, lines, line layer" />
|
12 | 12 | <meta name="author" content="Microsoft Azure Maps" />
|
| 13 | + <meta name="version" content="1.0" /> |
13 | 14 | <meta name="screenshot" content="screenshot.jpg" />
|
14 | 15 |
|
15 | 16 | <!-- Add references to the Azure Maps Map control JavaScript and CSS files. -->
|
|
26 | 27 | [-122.109186, 47.608526],
|
27 | 28 | [-122.111589, 47.580163]
|
28 | 29 | ];
|
29 |
| - |
| 30 | + |
30 | 31 | function GetMap() {
|
31 | 32 | //Initialize a map instance.
|
32 | 33 | map = new atlas.Map('myMap', {
|
|
68 | 69 | })
|
69 | 70 | );
|
70 | 71 |
|
71 |
| - //Create to line shapes for easy updating. A red straightline will be created to show the straight line path between the points. |
| 72 | + //Create to line shapes for easy updating. A red straightline will be created to show the straight line path between the points. |
72 | 73 | straightLine = new atlas.Shape(new atlas.data.LineString(positions), null, {
|
73 | 74 | color: 'red',
|
74 | 75 | width: 2
|
|
82 | 83 | //Add the lines to the data source.
|
83 | 84 | datasource.add([straightLine, spline]);
|
84 | 85 |
|
85 |
| - //Create a draggable HTML marker for each position. |
| 86 | + //Create a draggable HTML marker for each position. |
86 | 87 | for (var i = 0; i < positions.length; i++) {
|
87 | 88 | var marker = new atlas.HtmlMarker({
|
88 | 89 | draggable: true,
|
|
108 | 109 | positions[e.target.properties.index] = e.target.getOptions().position;
|
109 | 110 |
|
110 | 111 | //Calculate the cardinal spline coordinates and update the spline.
|
111 |
| - spline.setCoordinates(atlas.math.getCardinalSpline(positions, tension, nodeSize, close)); |
| 112 | + spline.setCoordinates(atlas.math.getCardinalSpline(positions, tension, nodeSize, close)); |
112 | 113 |
|
113 | 114 | //Update the lines with the new positions.
|
114 |
| - straightLine.setCoordinates(positions); |
| 115 | + straightLine.setCoordinates(positions); |
115 | 116 | }
|
116 | 117 |
|
117 | 118 | function calculateSpline() {
|
|
0 commit comments