Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Programmatically display base map when the rcp application starts.

Hi,

 

I am new to UDIG and RCP. I want to create an RCP application with   a base map. I have configured the base map as a project   and need to open this project when the user clicks on mapdisplay command  in RCP application.

I am using rcp tutorial provided with UDIG as a base reference.  Looking into the example ,  the map layers can be added in the createPartControl method of MapView class.

 

I got the code for adding layers through project

 

String PROJECT_ID="D:\\ Resources\\ProjectTemplates\\UDIGExample.udig";

      

         ProjectRegistry projectRegistry = 

         ProjectPlugin.getPlugin().getProjectRegistry();

 

         Project udigProject = projectRegistry.getProject(PROJECT_ID);

          

         List<IMap> list = udigProject.getElements(IMap.class);

 

         IMap map1 = list.get(0);

 

          List<ILayer> projectLayers = map1.getMapLayers();

 

         map1.sendCommandSync(BasicCommandFactory.getInstance().createAddManyLayers(projectLayers));

      

 

and looking into the example , once the map is defined it is added to mapViewer class through

 

mapViewer.setMap() method  , but this method accepts “net.refractions.udig.project.internal.Map” object and the object returned by

iterating ProjectRegistry is” net.refractions.udig.project.IMap”.

 

 

Once, the map is created, how can it be binded with the view? 

I have got some idea of retrieving map from the project, but how can that map be displayed in the view?

 

 

Thanks & Regards

Nidhi Arora

 

 

 

 

Thanks & Regards

Nidhi Arora

 

 

 

 

 

DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. 
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in 
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. 
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of 
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have 
received this email in error please delete it and notify the sender immediately. Before opening any mail and 
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

Back to the top