| | |
| | | } |
| | | </style> |
| | | <script> |
| | | var gAsync = true; |
| | | var gDebug = false; |
| | | var groupName = "空é´ç»è®¡"; |
| | | |
| | | function getGroupId() { |
| | | var gid = SGWorld.ProjectTree.FindItem(groupName); |
| | | if (gid) return gid; |
| | | |
| | | return SGWorld.ProjectTree.CreateLockedGroup(groupName); |
| | | } |
| | | |
| | | function delGroup() { |
| | | try { |
| | | var gid = SGWorld.ProjectTree.FindItem(groupName); |
| | | if (gid) SGWorld.ProjectTree.DeleteItem(gid); |
| | | } |
| | | catch (e) { |
| | | console.log(e); |
| | | } |
| | | } |
| | | |
| | | $(function () { |
| | | init(); |
| | | }); |
| | | |
| | | function init() { |
| | | window.ondragstart = function () { return false; } |
| | | |
| | | refreshList(); |
| | | } |
| | | |
| | | function refreshList() { |
| | | try { |
| | | $("#LayerId").html(""); |
| | | |
| | | var layers = [], index = 0; |
| | | BuildObjectsList(SGWorld.ProjectTree.RootID, layers, 36); |
| | | |
| | | layers.forEach(function (val) { |
| | | var name = SGWorld.ProjectTree.GetItemName(val); |
| | | $("#LayerId").append("<option value=" + val + (0 == index ? " selected='selected' " : "") + ">" + name + "</option>"); |
| | | index++; |
| | | }); |
| | | |
| | | if (layers.length) SGWorld.ProjectTree.SelectItem(layers[0]); |
| | | } catch (e) { |
| | | console.log(e); |
| | | } |
| | | } |
| | | |
| | | function changeLayer(e) { |
| | |
| | | } |
| | | |
| | | function startQuery(e) { |
| | | var id = parseInt($("#SelectType").val()); |
| | | SGWorld.Command.Execute(id, null); |
| | | delGroup(); |
| | | if (drawing.drawingEditMode != -1) { |
| | | drawing.abort(); |
| | | return; |
| | | } |
| | | |
| | | drawing.drawPolygon({ |
| | | style: { |
| | | lineColor: "#ff0000", |
| | | lineWidth: 3, |
| | | }, |
| | | altitudeMethod: 2, // use 2 of "OnTerrain" and 3 for "Absolute" (above mean sea level) |
| | | deleteWhenExit: false, // |
| | | parentGoupID: getGroupId(), |
| | | saveOnExit: true, // save the polyline/polygon when exiting the project. Default = false |
| | | onFinish: DrawPoly, |
| | | onAbort: ResetAsync |
| | | }); |
| | | } |
| | | |
| | | function DrawPoly(geometry, type, altitudeType) { |
| | | //SGWorld.Window.ShowMessageBarText("æ Esc é®éåº"); |
| | | SGWorld.ProjectTree.EnableRedraw(0); |
| | | } |
| | | |
| | | function ResetAsync(FirstTime, FromMouseInputMode) { |
| | | if (gAsync) |
| | | setTimeout(function () { Reset(FirstTime, FromMouseInputMode); }, 100); |
| | | else |
| | | Reset(FirstTime, FromMouseInputMode); |
| | | } |
| | | |
| | | function Reset(FirstTime, FromMouseInputMode) { |
| | | try { |
| | | if (gPolyObj != null) SGWorld.Creator.DeleteObject(gPolyObj.ID); |
| | | } catch (e) { } |
| | | |
| | | gPolyObj = null; |
| | | SGWorld.ProjectTree.EnableRedraw(1); |
| | | SGWorld.Window.HideMessageBarText(); |
| | | bInEdit = false; |
| | | |
| | | if (FirstTime != 1 && FromMouseInputMode == 0) SGWorld.Window.SetInputMode(0); |
| | | } |
| | | </script> |
| | | </head> |
| | |
| | | </tr> |
| | | <tr> |
| | | <td> |
| | | <object id="SGWorld" classid="CLSID:3a4f9199-65a8-11d5-85c1-0001023952c1"></object> |
| | | <object id="SGWorld" style="display:none" classid="CLSID:3a4f9199-65a8-11d5-85c1-0001023952c1"></object> |
| | | </td> |
| | | </tr> |
| | | </table> |