[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] access point to map of katerina browser
|
That is a rather complicated way of getting the map in my opinion.
A couple of questions. Is the map expected to be open already? Is it
the active map?
If it is the active and open map then you can get the map by:
If you are on trunk:
ApplicationGIS.getActiveMap() (this may return null if there is no open Map)
If the map is one of the open maps then you can do:
ApplicationGIS.getMaps() (this gives you the list of open maps).
If it is closed then you can:
ApplicationGIS.getProjects()
which will get you all the project in the system.
if you are on 1.0.x branch:
PlatformGIS.getActiveMap() (this may return null if there is no open Map)
If the map is one of the open maps then you can do:
PaltformGIS.getMaps() (this gives you the list of open maps). It think
this one exists in 1.0.x
If it is closed then you can:
ProjectPlugin.getDefault().getProjectRegistry.getProjects();
which will get you all the project in the system.
Jesse
Geordie Hobart wrote:
I think this is directed toward Jessie but I am not sure.
I am building a class LocationView (extending SearchPart) that will
tell the Map?? of the Katrina Browser plugin using a method
showLocation(Feature). I need to know how th get back the map so i
can use a command factory and tell it what to do. I found the
following code in BookMarkAction
URI mapID = bookmark.getMap().getMapID();
IMap map = (IMap)
(ProjectPlugin.getPlugin().getProjectRegistry().eResource()
.getResourceSet().getResource(mapID,true).getContents().get(0));
PlatformGIS.openMap(map);
IViewportModel v = map.getViewportModel();
Would I do something similar?
Thanks.