From: <e_t...@us...> - 2007-07-31 13:50:55
|
Revision: 684 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=684&view=rev Author: e_tajariol Date: 2007-07-31 06:50:34 -0700 (Tue, 31 Jul 2007) Log Message: ----------- Destination image dimensions are mandatory now. Modified Paths: -------------- trunk/src/org/wfp/vam/intermap/services/map/Action.java trunk/src/org/wfp/vam/intermap/services/map/FullExtent.java trunk/src/org/wfp/vam/intermap/services/map/Move.java trunk/src/org/wfp/vam/intermap/services/map/Update.java Modified: trunk/src/org/wfp/vam/intermap/services/map/Action.java =================================================================== --- trunk/src/org/wfp/vam/intermap/services/map/Action.java 2007-07-31 13:48:42 UTC (rev 683) +++ trunk/src/org/wfp/vam/intermap/services/map/Action.java 2007-07-31 13:50:34 UTC (rev 684) @@ -31,10 +31,12 @@ int mapimgy = Integer.parseInt(params.getChildText("mapimgy")); int mapimgx2 = Integer.parseInt(params.getChildText("mapimgx2")); int mapimgy2 = Integer.parseInt(params.getChildText("mapimgy2")); - - int width = Util.parseInt(params.getChildText("width"), MapUtil.getImageWidth(context)); - int height = Util.parseInt(params.getChildText("height"), MapUtil.getImageHeight(context)); - + +// int width = Util.parseInt(params.getChildText("width"), MapUtil.getImageWidth(context)); +// int height = Util.parseInt(params.getChildText("height"), MapUtil.getImageHeight(context)); + int width = Integer.parseInt(params.getChildText("width")); + int height = Integer.parseInt(params.getChildText("height")); + MapMerger mm = MapUtil.getMapMerger(context); BoundingBox bb = Util.parseBoundingBox(params); // search bb in params Modified: trunk/src/org/wfp/vam/intermap/services/map/FullExtent.java =================================================================== --- trunk/src/org/wfp/vam/intermap/services/map/FullExtent.java 2007-07-31 13:48:42 UTC (rev 683) +++ trunk/src/org/wfp/vam/intermap/services/map/FullExtent.java 2007-07-31 13:50:34 UTC (rev 684) @@ -41,8 +41,11 @@ // Update the user session context.getUserSession().setProperty(Constants.SESSION_MAP, mm); - - return params; // ETJ ??? funge? + + return new Element("response") + .addContent(mm.getBoundingBox().toElement()) + .addContent(new Element("width").setText(params.getChildText("width"))) + .addContent(new Element("height").setText(params.getChildText("height"))); } } Modified: trunk/src/org/wfp/vam/intermap/services/map/Move.java =================================================================== --- trunk/src/org/wfp/vam/intermap/services/map/Move.java 2007-07-31 13:48:42 UTC (rev 683) +++ trunk/src/org/wfp/vam/intermap/services/map/Move.java 2007-07-31 13:50:34 UTC (rev 684) @@ -29,9 +29,12 @@ int deltay = Integer.parseInt(params.getChildText("deltay")); // Get the current image size from request OR from the user session - int width = Util.parseInt(params.getChildText("width"), MapUtil.getImageWidth(context)); - int height = Util.parseInt(params.getChildText("height"), MapUtil.getImageHeight(context)); - +// int width = Util.parseInt(params.getChildText("width"), MapUtil.getImageWidth(context)); +// int height = Util.parseInt(params.getChildText("height"), MapUtil.getImageHeight(context)); + // Get the current image size from request + int width = Integer.parseInt(params.getChildText("width")); + int height = Integer.parseInt(params.getChildText("height")); + MapMerger mm = MapUtil.getMapMerger(context); BoundingBox bb = Util.parseBoundingBox(params); Modified: trunk/src/org/wfp/vam/intermap/services/map/Update.java =================================================================== --- trunk/src/org/wfp/vam/intermap/services/map/Update.java 2007-07-31 13:48:42 UTC (rev 683) +++ trunk/src/org/wfp/vam/intermap/services/map/Update.java 2007-07-31 13:50:34 UTC (rev 684) @@ -4,13 +4,14 @@ import jeeves.server.ServiceConfig; import jeeves.server.context.ServiceContext; import org.jdom.Element; +import org.wfp.vam.intermap.Constants; import org.wfp.vam.intermap.kernel.map.MapMerger; import org.wfp.vam.intermap.kernel.map.mapServices.BoundingBox; import org.wfp.vam.intermap.util.Util; //============================================================================= -/** main.result service. shows search results +/** */ public class Update implements Service @@ -26,11 +27,24 @@ public Element exec(Element params, ServiceContext context) throws Exception { // Get the current image size from the user session - int width = Util.parseInt(params.getChildText("width"), MapUtil.getImageWidth(context)); - int height = Util.parseInt(params.getChildText("height"), MapUtil.getImageHeight(context)); + /*DEBUG*/if(params.getChildText("width") == null) System.out.println("\n\nNO WIDTH SPECIFIED IN Update()\n"); + +// int width = Util.parseInt(params.getChildText("width"), MapUtil.getImageWidth(context)); +// int height = Util.parseInt(params.getChildText("height"), MapUtil.getImageHeight(context)); + int width = Integer.parseInt(params.getChildText("width")); + int height = Integer.parseInt(params.getChildText("height")); MapMerger mm = MapUtil.getMapMerger(context); + // Add default context if none exists + if (mm.size() == 0) // No layers to merge + { + System.out.println("Update: SETTING DEFAULT CONTEXT"); + MapUtil.setDefaultContext(mm); + // Update the user session + context.getUserSession().setProperty(Constants.SESSION_MAP, mm); + } + BoundingBox bb = Util.parseBoundingBox(params); // search bb in params if( bb != null) mm.setBoundingBox(bb); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |