www.skylinesoft.com Homepage
Forum Home Forum Home > SkylineGlobe General Support > Using SkylineGlobe API
  New Posts New Posts RSS Feed: Saving layers in "my layers" list
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Saving layers in "my layers" list

 Post Reply Post Reply
Author
Message
Gabbro View Drop Down
Skyline Government/Military Customers
Skyline Government/Military Customers
Avatar

Joined: January 03 2006
Location: Italy
Online Status: Offline
Posts: 3
Post Options Post Options   Quote Gabbro Quote  Post ReplyReply Direct Link To This Post Topic: Saving layers in "my layers" list
    Posted: March 22 2010 at 11:06am

Hello,

anyone knows how to save a layer in the "myLayers" list which appears on top of the layers tree in SkylineGlobe? What interface and method should I use?

Thank you in advance

Gabriele

Gabriele NICOLO'
Environmental Protection Agency of Piemonte
Torino - ITALY
Back to Top
Gabbro View Drop Down
Skyline Government/Military Customers
Skyline Government/Military Customers
Avatar

Joined: January 03 2006
Location: Italy
Online Status: Offline
Posts: 3
Post Options Post Options   Quote Gabbro Quote  Post ReplyReply Direct Link To This Post Posted: March 31 2010 at 10:12am

Hello, I received a reply from Eylon and I share it. Thanks Eylon for your suggestions.

In order to save a layer in "my layers" list I need to use the FindItem() method as in the rough example below where a layer is selected from a browse file object. For instance you can add this code to the "addlayer.aspx" and when the layers tool is unloaded it saves the content of the MyLayers group to the SGMyLayersMyUsername.fly which will be automatically loaded in the next session.

<SCRIPT Language="VBSCRIPT">
 Dim ICoordSys, NewLayer, IInfoTree,  FilePath, MyLayersId, myLayer, XMLLayInfo 

 sub LoadLayer()  
 
 Set ICoordSys = TE.interface("ICoordSys")
 
 Set IInfoTree = TE.interface("IInformationTree5")
 
   'Set the value of the file path variable
   FilePath = BrowseFile.value 'Browsefile is an input object I have defined in the body of my html (<INPUT TYPE="file" NAME="BrowseFile"/>)
   
  'Get Terrain Coordinate System keys, to be used as start parameters for the Dialog.
 
 ICoordSys.GetTerrainCS Group, System, Datum, Unit, EPGS
 
 ICoordSys.ChooseCSDialog chosen, Group, System, Datum, Unit, EPGS, 0, "Choose Client Coordinate System"
 
 if (chosen) then
 
    ICoordSys.SetSourceCS Group, System, Datum, Unit, EPGS
 
 else
 
    'SetCoordinateSystem()
      MsgBox "You did not choose any CS"
 
   end if
   ' define the feature layer XML string
   XMLLayInfo = "<PlugData><PlugType>shape</PlugType><LayerName>" & FilePath & "</LayerName><AttributesToLoad></AttributesToLoad ><Feature>1</Feature ><Annotation>0</Annotation><SaveItems>1</SaveItems><GroupKey>"& Group &"</GroupKey><SysKey>" & System & "</SysKey><DatumKey>" & Datum & "</DatumKey><UnitKey>" & Unit & "</UnitKey><UseZValue>0</UseZValue><AltitudeUnit>Meters</AltitudeUnit><Reproject>1</Reproject></PlugData >" 
 
  ' look for "myLayers" folder
   MyLayersId = IInfoTree.FindItem("MyLayers")

 NewLayer = "MyLayer"
 Set myLayer = IInfoTree.CreateLayer (NewLayer,XMLLayInfo, MyLayersId)
   myLayer.Load()
 
   end sub
</SCRIPT>

Gabriele

Gabriele NICOLO'
Environmental Protection Agency of Piemonte
Torino - ITALY
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.078 seconds.