[Thread Prev][Thread Next][Index]

Re: [las_users] LAS: custumizing interface for single time series


I took a look at your interface and tried to reproduce your situation as best I could without having your exact configuration. There were certainly a couple of bugs in the "two-click" map interface that show up most prominently when the restricted area in the map (the gray part) is quite large. The first bug was preventing the point tool from being painted when the the map first loads. In the second bug the code that deals with clicks was not properly handling clicks outside of the valid area. I've attached patch diffs you can use to fix your version of the code.

If your browser supports the "interactive" map, but gets switched to the "two-click" map unnecessarily, you can control this behavior by following the instructions here: http://ferret.pmel.noaa.gov/LASdoc/serve/cache/75.html.

Hopefully, installing these fixes will make the interface work well with your data. If not, please let me know.


Martin Schmidt wrote:
Hi all,
I have put a single time series on my LAS. Basically it works
but needs some streamlining. I would need some suggestions or help here.
I am using

Selecting dataset and variable, the server falls into the "two-click" map. The "interactive" map can be started, but there
is no reason to do this. This is a problem of netscape and the server,
but I must expect, that this happens for other users too.

Selecting some time slice and the output options now and clicking "next", results in an error message of ferret, that the selected horizontal co-ordinates are out of range compared with the co-ordinates in the dataset.

Ferret is correct, the reason is the "two-click" map, which
has initial integer values, which differ from the co-ordinates.

Hiting "Reset" helps, the horizontal co-ordinates are set now
exactly to the stations position. However, nobody will do this
and some users will return without output.

I am sure, that several users will fall into this trap and I would
like to avoid this.

I tried to set up my own user interface. I defined a region,
which points to the station. <menu type="regions" name="Regions_hix">
<item values="-5.7,-5.7,-15.97,-15.97"> Region </item>
However, this is ignored by LAS
as long as the "two-click" map is active. Clicking at another
point in the map and using the region menue to return to
the station position, gives again the wrong initial integer
Clicking "go", when wrong co-ordinates are selected, gives
a lengthy list of java errors.
All these errors can be reproduced with the windows explorer,
when the "two click" map is selected.

I tried to change std_initialize.jnl. This does not help,
because regions defined here are ignored.
So my questions:
- How can I get a passive "two-click" map, which does not
accept any selections and points to the stations position?

- Is it possible to remove the livemap completely, but only
for this dataset. Instead a gif, which marks the station could
be there.

- My gif for the map has another aspect ratio then the world map.
Hence, half of the map area is black. Is there some place, where this can be configured? I tried to adjust the user interface.
(For another dataset, with the same map). The positions selected
with the mouse seem to be correct, but the half black figure looks strange.
<image name="Image_hix" url="gifs/Atlantic.gif" bounds="-20,20,-40,10"/>
</images> The image was created as proposed at the LAS web pages.

The server is
St. Helena Island Climate Index (HIX) 1892-2006 is the
dataset with problems.

Many thanks in advance,
Martin Schmidt

Index: gov/noaa/pmel/tmap/map/MapGenerator.java
--- gov/noaa/pmel/tmap/map/MapGenerator.java	(revision 135)
+++ gov/noaa/pmel/tmap/map/MapGenerator.java	(working copy)
@@ -333,11 +333,15 @@
+  public Rectangle2D getRestrictedCoordinates() {
+     return mRestrictedRect;
+  }
   private double getOverlapDelta(Rectangle2D a, Rectangle2D b) {
     return (a.getX() < b.getX())? 360.0 : -360.0;
-  static private boolean intersects(Rectangle2D r1, Rectangle2D r2) {
+  static public boolean intersects(Rectangle2D r1, Rectangle2D r2) {
     double x0 = r1.getX();
     double y0 = r1.getY();
     double x = r2.getX();
Index: gov/noaa/pmel/tmap/ConstrainBean.java
--- gov/noaa/pmel/tmap/ConstrainBean.java	(revision 135)
+++ gov/noaa/pmel/tmap/ConstrainBean.java	(working copy)
@@ -1088,10 +1088,12 @@
                      throw new ServletException(e.getMessage());
+                  setMarkerToolType(mapState, stuff);
                   gen = stuff.gen;
               gen.setRestrictedCoordinates(xlod, xhid, ylod, yhid);
               setRestrictedViewWindow(xlod, xhid, ylod, yhid, gen, liveMap); 
+              sessionContext.put("mapgen",stuff);
          else {
          // Case 1,5,7
@@ -1261,6 +1263,29 @@
+      /*
+       * Check for intersection with current restricted view.
+       * If yes, go on, if no, return with no action.
+       *
+       */
+       Point2D myclick = new Point2D.Double(Double.valueOf(x).doubleValue(),
+                                          Double.valueOf(y).doubleValue());
+       Point2D myworld = gen.userToWorld(myclick);
+       Rectangle2D restricted = gen.getRestrictedCoordinates();
+       Rectangle2D marker = new Rectangle2D.Double(myworld.getX(), myworld.getY(), 0, 0);
+       if ( !gen.intersects(marker, restricted) ) {
+          mArgs.clear();
+          mArgs.add("op=none");
+          mapState.setDelayedMapOp(Utils.join("&", mArgs));
+          sessionContext.setMapState(mapState);
+          return;
+       }
       // If the draw state object is not set, assume it's a first click.
       if ( mapState.getCurrentMapCommand().equals("none") ) { 

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement