Opened 17 years ago
Closed 15 years ago
#43 closed enhancement (wontfix)
Add initial extent to Intermap contexts
Reported by: | jtheelen | Owned by: | sgiaccio |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Web Map Viewer | Version: | 2.1.0 Final |
Keywords: | Intermap initial BBOX | Cc: |
Description
It would be nice to have the ability to define an initial extent or bounding box to the map contexts in the Intermap mapServers.xml configuration file. An example could be to start with the initial extent for Europe, if your catalogue only contains metadata for Europe. This can be done very easy, for instance:
- extend the <context> elements in mapServer.xml with 4 extra attributes, like so:
<context minx="-18.16987" maxx="26.81305" miny="27.6375" maxy="69.0603" name="geoserver"> <server url="http://localhost:8080/geoserver/wms" type="2"> <layer name="gn:world"></layer> </server> <server url="http://localhost:8080/geoserver/wms" type="2"> <layer name="gn:gboundaries"></layer> </server> </context>
- change the implementation of this Intermap service:
org.wfp.vam.intermap.services.map.SetContext
like so:
public Element exec(Element params, ServiceContext context) throws Exception { int id = Integer.parseInt(params.getChildText(Constants.CONTEXT_ID)); // Create a new MapMerger object MapMerger mm = new MapMerger(); // ... MapUtil.setDefBoundingBox(mm); // Extra code for initial bounding box String contextMinx = mapContext.getAttributeValue("minx"); String contextMaxx = mapContext.getAttributeValue("maxx"); String contextMiny = mapContext.getAttributeValue("miny"); String contextMaxy = mapContext.getAttributeValue("maxy"); if ((contextMinx != null) && (contextMaxx != null) && (contextMiny != null) && (contextMaxy != null)) { MapUtil.setBBoxFromUrl(contextMinx + "," + contextMiny + "," + contextMaxx + "," + contextMaxy, mm); } // Set image size if not set String size = (String) context.getUserSession().getProperty(Constants.SESSION_SIZE); // ... return null; }
Two other options would be:
- replace the mapServers.xml configuration file with a real Web Map Context configuration file (requires some reimplementation of Intermap);
- replace Intermap with Mapbuilder (which uses already WMC as its configuration file).
Change History (3)
comment:1 by , 16 years ago
Milestone: | v2.1.1 |
---|
comment:2 by , 16 years ago
Owner: | changed from | to
---|
comment:3 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Milestone v2.1.1 deleted