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
|