1
Surpriseplus
2022-10-14 6d536dea3cec157947947aa075bebde4305f29b9
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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title>ToolTitle</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="StyleSheet" href="Style.css" type="text/css">
    <style>
    </style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="border: 0px" id="Body"  class="hideUntillTranslated" onload="Init()">
    <!--oncontextmenu="return false;">  onclick="bHide=true;HideOptionsNow()" > -->
    <table border="0" width="100%" cellspacing="0" cellpadding="2">
        <tr>
            <td class="ToolTopArea" id="TopAreaTD" width="100%" valign="middle" >
                <table border="0" width="100%" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="55px"><img style="margin-left:5px;" src="ToolIcon.png" alt="" /></td>
                        <td id="TitleTD" align="center" class="s12w i18n">ToolName</td>
                        <td align="right" id="CloseHelpTd"><img style="margin-right:5px;" alt="" src="../CommonImg/help.png" border="0" class="i18n" alt="help" title="help" onclick="DisplayHelpPopup6(SGLang.i18nFile('help.html'),SGLang.i18n('help'))" style="cursor: pointer;"></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td  class="ToolTopSeperator"></td>
        </tr>        <tr class="s8">
            <td >
                <table class="PropertiesSheet" cellspacing="0" cellpadding="2" >
        <tr class='TableOtherLine'>
            <td class="s8b">
                <label for="createAs"  class="i18n">Text0</label>
            </td>
            <td align="left">
                &nbsp;<select id="createAs" >
                    <option class="i18n" value="Layer" >Text2</option>
                    <option class="i18n" value="LayerStreaming" selected="selected">Text3</option>
                </select>
            </td>     
        </tr>
        <tr class='TableOtherLine'> <!-- Distance between points-->
            <td class="s8b ">
                <span id="DistanceText" class="i18n">Text8</span>
            </td>
            <td align="left">
                &nbsp;<input id="distance" type="text" value="10" size="7" onchange="CheckNumberEx(distance,10,0.01,999999)" />
                <span class="i18n">Text9</span>
            </td>
        </tr>
    </table>
        <tr class="s8">
            <td colspan="2" align="center"  class="ToolButtonsArea">
                <button id="lineButton" class="MenuButton" onclick="CreateObjects(1);">               <img src="../CommonImg/polyline.png" /><br />         <span class="i18n">Text33</span></button>
                <button id="areaButton" class="MenuButton"  onclick="CreateObjects(2);"><img src="../CommonImg/polygon.png" /><br /><span class="i18n">Text34</span></button>
                <button id="groupButton" class="MenuButton" onclick="SelectGroupObjects()"><img src="../CommonImg/group.png" /><br /><span class="i18n">Text35</span></button>
                <button id="clipboardButton" class="MenuButton MenuButtonLast" onclick="SelectClipboardObjects()"><img src="../CommonImg/clipboard.png" /><br /><span class="i18n">Text36</span></button>
            </td>
        </tr>
    </table>
    <div>图例说明:
        <P class=MsoNormal>
            <LI>天蓝色 = 坡度值低于6度
            <LI>蓝色 = 坡度值在6-17度之间
            <LI>绿色 = 坡度值在12-31度之间
            <LI>黄色 = 坡度值在31-38度之间
            <LI>橙色 = 坡度值在38-45度之间
            <LI>红色 = 坡度值大于45度
        <P></P>
    </div>
    <object id="SGWorld" classid="CLSID:3a4f9197-65a8-11d5-85c1-0001023952c1">
    </object>
 
 
<script language="javascript" src="js/ToolsCommon65.js"></script>
 
<script language="JavaScript">
 
 
//** this is a global variables for the polyline/polygon drawings
var gPolyObj =null;
var gPolyMethod;
var gPolygonText = SGLang.i18n("Text35");
var gPolylineText = SGLang.i18n("Text36");
var gDrawPolyClick = null;
var gEndDrawPoly = DrawPoly;
 
//**
 
var gFoundLine = false;
var PointLayer;
var gPositionsArray = [];
var gSlopeValueArray = [];
var gSlopeDirectionArray = [];
var gAltitudeArray = [];
var gPointsIndex = 0;
var gVisibilityDistance;
 
var bInEdit;
var bFirstTime;
var bDontAskme;
///var gTotalHours;
var rootId;
 
Date.prototype.stdTimezoneOffset = function () {
    var jan = new Date(this.getFullYear(), 0, 1);
    var jul = new Date(this.getFullYear(), 6, 1);
    return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}
 
Date.prototype.dst = function () {
    return this.getTimezoneOffset() < this.stdTimezoneOffset();
}
 
//--------------
// Init
function Init() {
    if (GetParamValue("inSG", "") == "1") {
        $("#TopAreaTD").attr("height", "57");
        $("#TitleTD").attr("align", "left");
        $("#CloseHelpTd").attr("display", "none");
    }
    gDrawPolyAltitudeType = 3; // draw lines and polygon as absolute lines
    rootId = GetParamValue("rootId", SGWorld.ProjectTree.RootID);
    Reset(1, 0);
}
//------------------
// Reset
//------------------
function Reset(FirstTime, FromMouseInputMode) {
 
    try {
        if (gPolyObj != null)
            SGWorld.Creator.DeleteObject(gPolyObj.ID);
    } catch (e) { }
 
    if (gPointsIndex > 0) {
        if (AnalyzePoints())
            DrawPoints();
    }
 
    if (PointLayer != null)
    {
        PointLayer.Save();
    }
    gPolyObj = null;
    GroupID = null;
    PointLayer = null;
    gPointsIndex = 0;
    gPositionsArray = [];
    gSlopeValueArray = [];
    gSlopeDirectionArray = [];
    gAltitudeArray = [];
 
    //    gSlopeArray = [];
    gVisibilityDistance = 3000;
 
    bDontAskme = false;
 
    $("#lineButton").removeClass("MenuButtonHighlight");
    $("#areaButton").removeClass("MenuButtonHighlight");
    $("#groupButton").removeClass("MenuButtonHighlight");
    $("#clipboardButton").removeClass("MenuButtonHighlight");
 
    SGWorld.ProjectTree.EnableRedraw(1);
    SGWorld.Window.HideMessageBarText();
 
    if (bInEdit) {
        SGWorld.DetachEvent("OnLButtonDown", DrawPolyLButtonDown);
        SGWorld.DetachEvent("OnRButtonUp", DrawPolyRButtonUp);
        SGWorld.DetachEvent("OnFrame", DrawPolyOnFrame);
        SGWorld.DetachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
    }
    bInEdit = false;
 
    if (FirstTime != 1 && FromMouseInputMode == 0)
        SGWorld.Window.SetInputMode(0);
}
//--------------
// CreateObjects
//--------------
function CreateObjects(method) {
    if (!bInEdit) {
        bInEdit = true;
        SGWorld.AttachEvent("OnLButtonDown", DrawPolyLButtonDown);
        SGWorld.AttachEvent("OnRButtonUp", DrawPolyRButtonUp);
        SGWorld.AttachEvent("OnFrame", DrawPolyOnFrame);
        SGWorld.AttachEvent("OnInputModeChanged", DrawPolyInputModeChanged);
 
 
        gPolyMethod = method;
        SGWorld.Window.SetInputMode(1, abspath() + "/cursor_m.cur");
        SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text16"));
        $(event.srcElement).addClass("MenuButtonHighlight");
 
    }
    else {
        DrawPolyRButtonUp(0, 0, 0, 0);
    }
}
//-----------
// SelectGroupObjects
function SelectGroupObjects() {
    var node = SGWorld.ProjectTree.GetNextItem("", 10);
    if (node == 0 || !(SGWorld.ProjectTree.IsGroup(node) || SGWorld.ProjectTree.IsLayer(node))) {
        alert(SGLang.i18n("Text24"));
        return;
    }
    $(event.srcElement).addClass("MenuButtonHighlight");
    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
    gFoundLine = false;
    searchGeometries2(node, DrawPoly);
    if (!gFoundLine)
        alert(SGLang.i18n("Text47"));
 
    Reset(0, 0);
}
//-----------
// SelectClipboardObjects
function SelectClipboardObjects() {
 
    $(event.srcElement).addClass("MenuButtonHighlight");
    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"), -1);
    gFoundLine = false;
    searchGeometriesClipboard(DrawPoly);
    if (!gFoundLine)
        alert(SGLang.i18n("Text48"));
    Reset(0, 0);
}
 
//-------------
// DrawPoly
function DrawPoly(geometry, type, altitudeType) {
 
    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19"));
    SGWorld.ProjectTree.EnableRedraw(0);
 
    if (!ValidateInput())
        return false;
 
    if (type == 1) {
        if (!DrawOnPolyline(geometry, type, altitudeType))
            return false;
    }
    else if (type == 2)
    {
        if (!DrawOnPolygon(geometry, type, altitudeType))
            return false;
    }
    else // Selected points
    {
        var tmpCoord = geometry.Copy(); // to avoid changes in the CurrCoord value in the DrawObject function
        //AddPoint(tmpCoord);
 
    }
 
 
    return true;
 
}
//----
// DrawOnPolyline
function DrawOnPolyline(polylineGeometry, type, altitudeType) {
    var lastCoord;
    var currCoord;
    var tmpCoord;
    var SegmentLength;
    var lastSegmentLenght;
    gFoundLine = true;
    var distance = validateNumber($("#distance").attr("value"));
    var LeftOver = 0;
    var totlaDistance = 0;
 
    for (var k = 1; k < polylineGeometry.Points.count; k++)   // calculate total distance
    {
        lastCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(k - 1).X, polylineGeometry.Points.Item(k - 1).Y, polylineGeometry.Points.Item(k - 1).Z, altitudeType);
        currCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(k).X, polylineGeometry.Points.Item(k).Y, polylineGeometry.Points.Item(k).Z, altitudeType);
        totlaDistance += lastCoord.DistanceTo(currCoord);
    }
 
    var firstSegment = true;
    for (var i = 1; i < polylineGeometry.Points.count; i++) {
        lastCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(i - 1).X, polylineGeometry.Points.Item(i - 1).Y, polylineGeometry.Points.Item(i - 1).Z, altitudeType);
        currCoord = SGWorld.Creator.CreatePosition(polylineGeometry.Points.Item(i).X, polylineGeometry.Points.Item(i).Y, polylineGeometry.Points.Item(i).Z, altitudeType);
 
        lastCoord.yaw = lastCoord.AimTo(currCoord).yaw;
        lastCoord = lastCoord.MoveToward(currCoord, -LeftOver);
 
        if (firstSegment) {
            tmpCoord = lastCoord.Copy();
            if (AddToPointsList(tmpCoord) == false)
                return false;
        }
        SegmentLength = lastCoord.DistanceTo(currCoord);
        lastSegmentLenght = SegmentLength;
 
        while (SegmentLength >= distance && lastSegmentLenght >= SegmentLength) {
            lastSegmentLenght = SegmentLength;
            lastCoord = lastCoord.MoveToward(currCoord, distance);
            tmpCoord = lastCoord.Copy();
            if (AddToPointsList(tmpCoord) == false)
                return false;
            SegmentLength = lastCoord.DistanceTo(currCoord);
        }
 
        LeftOver = SegmentLength;
 
        firstSegment = false;
    }
    // fix for bug #14439
    //Restore3DModelToGroundObject();
    return true;
}
//-----------
// DrawOnPolygon
function DrawOnPolygon(polygonGeometry, type, altitudeType) {
    var envelope = polygonGeometry.Envelope; // Multi polygon evnelope (min/max)
 
    gFoundLine = true;
    //// var pos = SGWorld.Navigate.GetPosition();
    CreateTheObjects = true;
    var MinX = Math.min(envelope.Rings(0).Points(0).x, envelope.Rings(0).Points(2).x);
    var MaxX = Math.max(envelope.Rings(0).Points(0).x, envelope.Rings(0).Points(2).x);
    var MinY = Math.min(envelope.Rings(0).Points(0).y, envelope.Rings(0).Points(2).y);
    var MaxY = Math.max(envelope.Rings(0).Points(0).y, envelope.Rings(0).Points(2).y);
 
    var XDist = SGWorld.CoordServices.GetDistance(MinX, MinY, MaxX, MinY);
    var YDist = SGWorld.CoordServices.GetDistance(MinX, MinY, MinX, MaxY);
    var distanceVal = validateNumber($("#distance").attr("value"));
 
    var currCoord;
    switch (polygonGeometry.GeometryType) {
        case 3: // ipolygon
            currCoord = SGWorld.Creator.CreatePosition(MinX, MinY, polygonGeometry.Rings(0).Points.Item(0).Z, altitudeType, 0);
            break;
        case 6: // imultipolygon
            currCoord = SGWorld.Creator.CreatePosition(MinX, MinY, polygonGeometry.Item(0).Rings(0).Points.Item(0).Z, altitudeType, 0);
            break;
    }
 
    var currCoordAlt = currCoord.Altitude;
 
    while (currCoord.x < MaxX) {
        currCoord.y = MinY;
        while (currCoord.y < MaxY) {
            var pointGeometry = SGWorld.Creator.GeometryCreator.CreatePointGeometry([currCoord.x, currCoord.y, 0]);
            if (polygonGeometry.SpatialRelation.Intersects(pointGeometry)) {
                var tmpCoord = currCoord.Copy(); // to avoid changes in the CurrCoord value in the DrawObject function
                if (AddToPointsList(tmpCoord) == false)
                    return false;
            }
            currCoord = currCoord.Move(distanceVal, 0, 0);
            currCoord.Altitude = currCoordAlt;
        }
        currCoord = currCoord.Move(distanceVal, 90, 0);
        currCoord.Altitude = currCoordAlt;
    }
 
    return true;
}
//------------
//  AddToPointsList
function AddToPointsList(position) {
    position.Altitude = 0;
    position.AltitudeType = 0;
    AddPoint(position);
}
//-------------
// AddPoint
function AddPoint(pos) {
    var position1 = pos.ToAbsolute(0);
    gPositionsArray[gPointsIndex] = position1;
    gSlopeValueArray[gPointsIndex] = 0;
    gSlopeDirectionArray[gPointsIndex] = 0;
    gAltitudeArray[gPointsIndex] = 0;
    gPointsIndex += 1;
    if (gPointsIndex / 100.0 == Math.floor(gPointsIndex / 100.0))
        SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text19")+": "+gPointsIndex);
 
}
//------------
//  AnalyzePoints
function AnalyzePoints() {
 
    var totalPoints = gPointsIndex;
    var CreateTheObjects = true;
    if (totalPoints > 20000)
        CreateTheObjects = confirm(SGLang.i18n("Text20") + totalPoints + SGLang.i18n("Text21"));
    if (!CreateTheObjects)
        return false;
    for (var i = 0; i < gPointsIndex; i++) {
            CalculateSlope (i);
        }
  
    return true;
}
//------------
//CalculateSlope
function CalculateSlope(slopeIndex) {
    try {
 
        var pos = gPositionsArray[slopeIndex].Copy();
        var distance = validateNumber($("#distance").attr("value"));
 
        var slopeSampling = 20;
        var getGroundHeighType = 2;
 
 
        //Groud height in mouse location
        var groundInfo = SGWorld.Terrain.GetGroundHeightInfo(pos.X, pos.Y, getGroundHeighType, true);
        gPositionsArray[slopeIndex].Altitude = groundInfo.Position.Altitude
        //Ground Height around mouse location
        var i;
        var maxPositiveAlt = -9999999;
        var maxPositivePos;
         var maxNegativeAlt = 9999999;
         var maxNegativePos;
        var destGroundInfo;
        var headingPos;
        var newPos = pos.Copy();
        // find min/max slopes
        for (i = 0; i < 360; i = i + slopeSampling) {
            newPos = pos.Copy();
            newPos.Yaw = i;
            SGWorld.CoordServices.MoveCoordEx(newPos, distance/2, 0, 0);
            destGroundInfo = SGWorld.Terrain.GetGroundHeightInfo(newPos.X, newPos.Y, getGroundHeighType, true);
 
            if (destGroundInfo.Position.Altitude > maxPositiveAlt) {
                maxPositiveAlt = destGroundInfo.Position.Altitude;
                maxPositivePos = destGroundInfo.Position.Copy();
            }
 
            if (destGroundInfo.Position.Altitude < maxNegativeAlt) {
                maxNegativeAlt = destGroundInfo.Position.Altitude;
                maxNegativePos = destGroundInfo.Position.Copy();
            }
        }
 
 
        maxPositivePos = maxPositivePos.AimTo(maxNegativePos);
        gSlopeValueArray[slopeIndex] = maxPositivePos.Pitch.toFixed(2);
        gSlopeDirectionArray[slopeIndex] = maxPositivePos.Yaw.toFixed(2);
        gAltitudeArray[slopeIndex] = pos.Altitude;
 
        if (slopeIndex / 100.0 == Math.floor(slopeIndex / 100.0)) {
            var prec = (slopeIndex / gPointsIndex) * 100;
            SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text26") + ": " + slopeIndex + "[" + prec.toFixed(1) + "%]");
        }
 
    }
    catch (err) {        alert(SGLang.i18n("Text25") + err);   Reset(0, 0); } 
}
//------------
//  DrawPoints
function DrawPoints() {
 
    for (var i = 0; i < gPointsIndex; i++) {
        DrawObject(gPositionsArray[i],i);
    }
    return true;
}
 
//---------
// DrawObject
function DrawObject(position, index) {
    var node;
    var TEObj;
    var ObjType = "ImageLabel";
    var distance = validateNumber($("#distance").attr("value"));
    var size = distance/200;
 
    var noiseVal = 0;
    var createAs = $("#createAs").val();
    var PointVisible;
 
    SGWorld.Window.ShowMessageBarText(SGLang.i18n("Text31") + " " + index, -1);
 
    var SlopeValue = Math.round(gSlopeValueArray[index] * 10) / 10;
    var SlopeValueAbs = Math.abs(SlopeValue); 
    var SlopeDirection = Math.round(gSlopeDirectionArray[index] * 10) / 10;
    var Altitude = Math.round(position.Altitude * 10) / 10;
 
    var IconColor = 0; // red + green * 256 + blue * 65536;
    if (SlopeValueAbs > 45)
        IconColor = 255 + 0 * 256 + 0 * 65536; // red
    else if (SlopeValueAbs > 38)
        IconColor = 244 + 167 * 256 + 68 * 65536; // orange
    else if (SlopeValueAbs > 31)
        IconColor = 255 + 255 * 256 + 0 * 65536; // yellow
    else if (SlopeValueAbs > 17)
        IconColor = 0 + 255 * 256 + 0 * 65536; // green
    else if (SlopeValueAbs > 6)
        IconColor = 0 + 0 * 256 + 255 * 65536; // blue
    else
        IconColor = 64 + 255 * 256 + 255 * 65536; // blue
 
    if (createAs != "Group") {  // Create a feature layer
        if (PointLayer == null) {
            CreateGroupOrLayer();
 
            // style the feature group
            if (featureLayerStyles[ObjType] != null) {
                var result = featureLayerStyles[ObjType](size, abspath() + "/arrow.png", "[" + SGLang.i18n("Text46") + "]");
                if (result === false)
                    return false;
            }
        }
 
        PointLayer.FeatureGroups.Point.CreateFeature([position.X, position.Y, position.Altitude + distance/20], SlopeValue + ";" + SlopeDirection + ";" + Altitude + ";" + IconColor);
    }
 
    return true;
 
}
//----------
//    CreateGroupOrLayer
function CreateGroupOrLayer() {
 
    var distance =  validateNumber($("#distance").attr("value"));
 
    if (PointLayer == null) {
        var postfix = new Date().getTime();
        var LayerName = SGLang.i18n("Text13") ;
        PointLayer = SGWorld.Creator.CreateNewFeatureLayer(LayerName, LayerGeometryType.LGT_POINT, "FileName=SlopeMapQuery" + postfix + ".shp;TEPlugName=OGR;", rootId);
        PointLayer.Streaming = $("#createAs").val() == "LayerStreaming";
        PointLayer.BlockWidth = distance*60;
        PointLayer.Refresh();
        PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text43"), 2, 20, 1); // Slope Value
        PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text44"), 2, 20, 1); // Slope Direction
        PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text45"), 2, 20, 1); // Altitude
        PointLayer.DataSourceInfo.Attributes.CreateAttribute(SGLang.i18n("Text46"), 1, 20, 0); // icon color
        PointLayer.DataSourceInfo.Attributes.ImportAll = true;
        PointLayer.Visibility.MaxVisibilityDistance = gVisibilityDistance;
        // style the feature group
        PointLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_LABEL;
 
    }
 
}
var featureLayerStyles = {
 
    "ImageLabel": function (size, param, param2) {
        PointLayer.FeatureGroups.Point.DisplayAs = ObjectTypeCode.OT_IMAGE_LABEL;
        PointLayer.FeatureGroups.Point.SetProperty("Image file", param);
        PointLayer.FeatureGroups.Point.SetProperty("Image Color", param2);
        PointLayer.FeatureGroups.Point.SetProperty("Lock Mode", 1);
        PointLayer.FeatureGroups.Point.SetProperty("Limit Growth", false);
        PointLayer.FeatureGroups.Point.SetProperty("Scale", size);
        PointLayer.FeatureGroups.Point.SetProperty("Altitude Method", 1);
        PointLayer.FeatureGroups.Point.SetProperty("Pivot Alignment", 17);
        PointLayer.FeatureGroups.Point.SetProperty("Yaw", " [" + SGLang.i18n("Text44") + "]");
        PointLayer.FeatureGroups.Point.SetProperty("Pitch", "<[" + SGLang.i18n("Text43") + "]>");
        
        PointLayer.FeatureGroups.Point.SetProperty("Altitude Method", 1);
        PointLayer.FeatureGroups.Point.SetProperty("Tool Tip", SGLang.i18n("Text43") + " [" + SGLang.i18n("Text43") + "]");
    }
 
}
 
 
//---------------
// ValidateInput
    function ValidateInput() {
        if ($("#startTime").attr("value") * 1.0 > $("#endTime").attr("value") * 1.0) {
        alert(SGLang.i18n("Text23"));
        return false;
    }
 
    return true;
}
//--------------
// CheckNumberEx
function CheckNumberEx(field, defVal, MinNum, MaxNum) {
    try {
        field.value = validateNumber(field.value);
 
        if (field.value < MinNum)
            field.value = MinNum;
        if (field.value > MaxNum)
            field.value = MaxNum;
    }
    catch (e) { field.value = defVal }
}
 
</script>
 
</body>
</html>
 
 
<!--Sig:00000040ju15IGvBp1DZypk60nHkJtIyMSeMkACjEyO#qdc#17fYzrIG8nX4M16WZ2#XUB4Fb1EkKhjxIZAQwnITyUjoXTJJ-->