Skip to main content

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


On 10/06/2010, at 4:11 PM, Nidhi Arora wrote:

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”.

Right.

You *can* cast from IMap to Map; usually we only do that in a command since we want to ensure that nothing is modifying the map. It may be safer to make a copy of the Map for use in the MapViewer? So you could open more then one.

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

I thought calling setMap was all that is needed; the example you found should go through the needed steps. You may need to show the correct extents for the map to be visible however.

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

I have not thought about the same map being displayed in both a MapViewer and in a MapEditor; this is my only hesitation in using a MapViewer out of a live project.

Jody


Back to the top