[biogeomancer-workbench] r478 committed - Working branch for Firefox with topo quads and links to new help locat...

2 views
Skip to first unread message

biogeomance...@googlecode.com

unread,
Oct 13, 2011, 2:47:27 AM10/13/11
to biogeomancer...@googlegroups.com
Revision: 478
Author: gtuco...@gmail.com
Date: Wed Oct 12 23:46:08 2011
Log: Working branch for Firefox with topo quads and links to new help
location.
http://code.google.com/p/biogeomancer-workbench/source/detail?r=478

Added:
/branches/topos/lib/biogeomancer-core-1.1.9.jar
/branches/topos/src/services.properties.template
Deleted:
/branches/topos/lib/biogeomancer-core-1.1.7.jar
/branches/topos/src/services.properties
Modified:
/branches/topos/.classpath
/branches/topos/build.xml
/branches/topos/src/org/biogeomancer/client/WorkBench.java
/branches/topos/src/org/biogeomancer/client/ui/GeorefMap.java
/branches/topos/src/org/biogeomancer/client/ui/WMSTileLayer.java
/branches/topos/src/org/biogeomancer/public/WorkBench.html

=======================================
--- /dev/null
+++ /branches/topos/lib/biogeomancer-core-1.1.9.jar Wed Oct 12 23:46:08 2011
File is too large to display a diff.
=======================================
--- /dev/null
+++ /branches/topos/src/services.properties.template Wed Oct 12 23:46:08
2011
@@ -0,0 +1,17 @@
+# services.properties
+jdbc.driver = org.postgresql.Driver
+db.protocol = jdbc:postgresql
+db.host = bg.berkeley.edu
+db.dbname = bgwb2
+db.user = postgres
+db.password =
+userplacesdb.protocol = jdbc:postgresql
+userplacesdb.host = bg.berkeley.edu
+userplacesdb.dbname = userplaces
+userplacesdb.user = postgres
+userplacesdb.password =
+placenamesdb.protocol = jdbc:postgresql
+placenamesdb.host = bg.berkeley.edu
+placenamesdb.dbname = worldplaces3
+placenamesdb.user = postgres
+placenamesdb.password =
=======================================
--- /branches/topos/lib/biogeomancer-core-1.1.7.jar Thu Mar 18 08:22:04 2010
+++ /dev/null
File is too large to display a diff.
=======================================
--- /branches/topos/src/services.properties Sat Sep 29 13:19:50 2007
+++ /dev/null
@@ -1,17 +0,0 @@
-# services.properties
-jdbc.driver = org.postgresql.Driver
-db.protocol = jdbc:postgresql
-db.host = bg.berkeley.edu
-db.dbname = bgwb2
-db.user = postgres
-db.password = napoleon
-userplacesdb.protocol = jdbc:postgresql
-userplacesdb.host = bg.berkeley.edu
-userplacesdb.dbname = userplaces
-userplacesdb.user = postgres
-userplacesdb.password = napoleon
-placenamesdb.protocol = jdbc:postgresql
-placenamesdb.host = bg.berkeley.edu
-placenamesdb.dbname = worldplaces3
-placenamesdb.user = postgres
-placenamesdb.password = napoleon
=======================================
--- /branches/topos/.classpath Thu Apr 17 18:28:26 2008
+++ /branches/topos/.classpath Wed Oct 12 23:46:08 2011
@@ -13,6 +13,6 @@
<classpathentry kind="lib" path="lib/mvzlib-0.5.4.jar"/>
<classpathentry kind="lib" path="lib/ostermillerutils_1_06_00.jar"/>
<classpathentry kind="lib" path="lib/postgresql-8.2dev-503.jdbc3.jar"/>
- <classpathentry kind="lib" path="lib/biogeomancer-core-1.1.4.jar"/>
+ <classpathentry kind="lib" path="lib/biogeomancer-core-1.1.9.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
=======================================
--- /branches/topos/build.xml Fri Apr 18 11:05:56 2008
+++ /branches/topos/build.xml Wed Oct 12 23:46:08 2011
@@ -15,7 +15,7 @@
<!--
Build properties.
-->
- <property name="version" value="1.1.0" />
+ <property name="version" value="1.2.6f" />
<property name="lib.dir" value="${basedir}/lib" />
<property name="src.dir" value="${basedir}/src" />
<property name="build.dir" value="${basedir}/build" />
@@ -107,7 +107,7 @@
copies all resource files (properties, xml, etc) to WEB-INF/lib.
-->
<target name="build" depends="init">
- <javac deprecation="off" includeAntRuntime="yes" debug="on"
srcdir="${src.dir}" destdir="${build.dir}/WEB-INF/classes">
+ <javac source="1.5" target="1.5" deprecation="off"
includeAntRuntime="yes" debug="on" srcdir="${src.dir}"
destdir="${build.dir}/WEB-INF/classes">
<include name="**/*.java" />
<classpath refid="lib.path" />
</javac>
@@ -182,7 +182,7 @@
<target name="tomcat-reinstall" depends="tomcat-remove, tomcat-install" />

<target name="tomcat-install">
- <deploy url="${tomcat.manager.url}" username="manager" password="pass"
path="${tomcat.path}" war="file://${dist.dir}/${dist.jar}" />
+ <deploy url="${tomcat.manager.url}" username="${tomcat.user}"
password="${tomcat.pass}" path="${tomcat.path}"
war="file://${dist.dir}/${dist.jar}" />
</target>

<target name="tomcat-reload">
@@ -190,7 +190,7 @@
</target>

<target name="tomcat-remove">
- <undeploy url="${tomcat.manager.url}" username="manager"
password="tomcat" path="${tomcat.path}" />
+ <undeploy url="${tomcat.manager.url}" username="${tomcat.user}"
password="${tomcat.pass}" path="${tomcat.path}" />
</target>

<!-- ===================================================================
=======================================
--- /branches/topos/src/org/biogeomancer/client/WorkBench.java Fri Jan 16
08:11:12 2009
+++ /branches/topos/src/org/biogeomancer/client/WorkBench.java Wed Oct 12
23:46:08 2011
@@ -16,6 +16,16 @@

package org.biogeomancer.client;

+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.DockPanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.Widget;
+
import org.biogeomancer.beans.Record;
import org.biogeomancer.client.ui.ActionLink;
import org.biogeomancer.client.ui.AuthListener;
@@ -38,18 +48,8 @@
import org.mvz.gwt.client.HistoryDispatcher;
import org.mvz.gwt.client.HistoryDispatcher.MyHistoryListener;

-import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.DockPanel;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.Widget;
-
public class WorkBench implements EntryPoint, AuthListener,
MyHistoryListener,
- RecordList.RecordListListener, LogoClickListener {
+ RecordList.RecordListListener, LogoClickListener {

private static class ElementWrapper extends Widget {
public ElementWrapper(String id) {
@@ -60,8 +60,7 @@
}
}

- private final WorkBenchController controller = WorkBenchController
- .getInstance();
+ private final WorkBenchController controller =
WorkBenchController.getInstance();

private final Dashboard dash = Dashboard.getInstance();

@@ -72,32 +71,31 @@
private final Form form = LocalityForm.getInstance();

private final Widget helpLink = new HTML(
- "<a
href='http://groups.google.com/group/biogeomancer-workbench-support"
- + "/web/biogeomancer-workbench-help'
target='_blank'>Help</a>");
+ "<a
href='https://sites.google.com/site/biogeomancerworkbench/support'
target='_blank'>Help</a>");

private final String HOME_TOKEN = "home";

private final Widget issueLink = new HTML(
- "<a
href='http://code.google.com/p/biogeomancer-workbench/issues/entry'
target='_blank'>Submit issue</a>");
+ "<a
href='http://code.google.com/p/biogeomancer-workbench/issues/entry'
target='_blank'>Submit issue</a>");

private final LocalityWidget loc = LocalityWidget.getInstance();

private final ActionLink loginLink = new ActionLink("Login",
- new ClickListener() {
- public void onClick(Widget w) {
- LoginWidget.getInstance().showPopup();
- }
- });
+ new ClickListener() {
+ public void onClick(Widget w) {
+ LoginWidget.getInstance().showPopup();
+ }
+ });

private final ActionLink logoutLink = new ActionLink("Logout",
- new ClickListener() {
- public void onClick(Widget w) {
- map.clear();
- LocalityForm.getInstance().setRecordID(-1);
- mast.hideFullLocality();
- UniqueUser.getInstance().logout();
- }
- });
+ new ClickListener() {
+ public void onClick(Widget w) {
+ map.clear();
+ LocalityForm.getInstance().setRecordID(-1);
+ mast.hideFullLocality();
+ UniqueUser.getInstance().logout();
+ }
+ });

private final GeorefMap map = GeorefMap.getInstance();

@@ -106,27 +104,27 @@
private final Navigation nav = Navigation.getInstance();

private final ActionLink projectsLink = new ActionLink("Projects",
- new ClickListener() {
- public void onClick(Widget w) {
- displayDashboard(true);
- }
- });
+ new ClickListener() {
+ public void onClick(Widget w) {
+ displayDashboard(true);
+ }
+ });

private final ActionLink registerLink = new ActionLink("Register",
- new ClickListener() {
- public void onClick(Widget w) {
- RegisterWidget.getInstance().showPopup();
- }
- });
+ new ClickListener() {
+ public void onClick(Widget w) {
+ RegisterWidget.getInstance().showPopup();
+ }
+ });

private final UndoWidget undo = UndoWidget.getInstance();

private final ActionLink userPrefsLink = new ActionLink("Preferences",
- new ClickListener() {
- public void onClick(Widget w) {
- PreferencesWidget.getInstance().showPopup();
- }
- });
+ new ClickListener() {
+ public void onClick(Widget w) {
+ PreferencesWidget.getInstance().showPopup();
+ }
+ });

private final HTML welcomeLabel = new HTML("Welcome!");

@@ -193,7 +191,7 @@
public void onAuthenticated() {

PreferencesWidget.getInstance().setUser(UniqueUser.getInstance().getUser());
welcomeLabel.setText("Logged in as "
- + UniqueUser.getInstance().getNickName());
+ + UniqueUser.getInstance().getNickName());
nav.remove(loginLink);
nav.remove(registerLink);
nav.add(projectsLink);
=======================================
--- /branches/topos/src/org/biogeomancer/client/ui/GeorefMap.java Fri Jan
16 12:29:46 2009
+++ /branches/topos/src/org/biogeomancer/client/ui/GeorefMap.java Wed Oct
12 23:46:08 2011
@@ -16,16 +16,6 @@

package org.biogeomancer.client.ui;

-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.biogeomancer.beans.Georef;
-import org.biogeomancer.beans.GeorefResponse;
-import org.biogeomancer.client.ui.markers.CreationMarker;
-import org.biogeomancer.client.ui.markers.EditRadiusState;
-import org.biogeomancer.client.ui.markers.GeorefMarker;
-
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.WindowResizeListener;
import com.google.gwt.user.client.ui.AbsolutePanel;
@@ -37,6 +27,7 @@
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.SourcesLoadEvents;
import com.google.gwt.user.client.ui.Widget;
+
import com.mapitz.gwt.googleMaps.client.GControl;
import com.mapitz.gwt.googleMaps.client.GControlAnchor;
import com.mapitz.gwt.googleMaps.client.GControlPosition;
@@ -52,8 +43,18 @@
import com.mapitz.gwt.googleMaps.client.GSize;
import com.mapitz.gwt.googleMaps.client.GTileLayerOverlay;

+import org.biogeomancer.beans.Georef;
+import org.biogeomancer.beans.GeorefResponse;
+import org.biogeomancer.client.ui.markers.CreationMarker;
+import org.biogeomancer.client.ui.markers.EditRadiusState;
+import org.biogeomancer.client.ui.markers.GeorefMarker;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
public class GeorefMap implements WindowResizeListener, LoadListener,
- SourcesLoadEvents, ClickListener {
+ SourcesLoadEvents, ClickListener {

private static final GLatLng DEFAULT_CENTER = new GLatLng(0, 0);

@@ -61,9 +62,9 @@

private static final int DEFAULT_ZOOM_LEVEL = 0;

- private static final String gadmToggleOffText = "GADM off";
-
- private static final String gadmToggleOnText = "GADM on";
+ private static final String gadmToggleOffText = "GADM";
+
+ private static final String gadmToggleOnText = "GADM is on";

private static GeorefMap instance;

@@ -78,17 +79,17 @@

private static final double MEXBATHIMETRY_LAYER_OPACITY = 0.75;

- private static final String mexBathimetryToggleOffText = "Bath off";
-
- private static final String mexBathimetryToggleOnText = "Bath on";
+ // private static final String mexBathimetryToggleOffText = "Bath off";
+
+ // private static final String mexBathimetryToggleOnText = "Bath on";

private static int record_id = -1;

private static final double TOPO_LAYER_OPACITY = 0.50;

- private static final String topoToggleOffText = "TOPO off";
-
- private static final String topoToggleOnText = "TOPO on";
+ private static final String topoToggleOffText = "TOPO";
+
+ private static final String topoToggleOnText = "TOPO is on";

public static GeorefMap getInstance() {
if (null == instance) {
@@ -100,28 +101,28 @@
private CreationMarker cmarker = null;;

private final WMSTileLayer gadmMap = new WMSTileLayer(
- "http://bg.berkeley.edu/cgi-bin/mapserv?map=/usr/local/apache2/htdocs/gadm.map&",
//
baseURL
- "gadm2", // layers
- 4, // minResolution
- 17); // maxResolution;
+ "http://bg.berkeley.edu/cgi-bin/mapserv?map=/usr/local/apache2/htdocs/gadm.map&",
//
baseURL
+ "gadm2", // layers
+ 4, // minResolution
+ 17); // maxResolution;

private final GTileLayerOverlay gadmOverlay = new
GTileLayerOverlay(gadmMap);

private final Button gadmOverlayToggle = new Button(gadmToggleOffText,
- new ClickListener() {
- private boolean gadmShowing = false;
-
- public void onClick(Widget sender) {
- gadmShowing = !gadmShowing;
- if (gadmShowing) {
- gMap.addOverlay(gadmOverlay);
- gadmOverlayToggle.setText(gadmToggleOnText);
- } else {
- gMap.removeOverlay(gadmOverlay);
- gadmOverlayToggle.setText(gadmToggleOffText);
- }
- }
- });
+ new ClickListener() {
+ private boolean gadmShowing = false;
+
+ public void onClick(Widget sender) {
+ gadmShowing = !gadmShowing;
+ if (gadmShowing) {
+ gMap.addOverlay(gadmOverlay);
+ gadmOverlayToggle.setText(gadmToggleOnText);
+ } else {
+ gMap.removeOverlay(gadmOverlay);
+ gadmOverlayToggle.setText(gadmToggleOffText);
+ }
+ }
+ });

private final ArrayList georefMarkers = new ArrayList();

@@ -153,11 +154,12 @@

private final ArrayList markerOverlays = new ArrayList();

- private final WMSTileLayer mexBathimetryMap = new WMSTileLayer(
- "http://www.unigeo.igeograf.unam.mx/wmsconnector/com.esri.wms.Esrimap?&ServiceName=NivelNacional250k&",
//
baseURL
- "18", // layers
- 4, // minResolution
- 17); // maxResolution
+ // private final WMSTileLayer mexBathimetryMap = new WMSTileLayer(
+
// "http://www.unigeo.igeograf.unam.mx/wmsconnector/com.esri.wms.Esrimap?&ServiceName=NivelNacional250k&",
+ // // baseURL
+ // "18", // layers
+ // 4, // minResolution
+ // 17); // maxResolution
// http://www.unigeo.igeograf.unam.mx/wmsconnector/com.esri.wms.Esrimap?
// BBOX=-118.5469119127,9.7881900549,-85.9560776432,36.4895498389
// &WIDTH=400&HEIGHT=300
@@ -169,23 +171,24 @@
// &TRANSPARENT=TRUE
// &request=getmap
// &ServiceName=NivelNacional250k
- private final GTileLayerOverlay mexBathimetryOverlay = new
GTileLayerOverlay(
- mexBathimetryMap);
- private final Button mexBathimetryOverlayToggle = new Button(
- mexBathimetryToggleOffText, new ClickListener() {
- private boolean mexBathimetryShowing = false;
-
- public void onClick(Widget sender) {
- mexBathimetryShowing = !mexBathimetryShowing;
- if (mexBathimetryShowing) {
- gMap.addOverlay(mexBathimetryOverlay);
-
mexBathimetryOverlayToggle.setText(mexBathimetryToggleOnText);
- } else {
- gMap.removeOverlay(mexBathimetryOverlay);
-
mexBathimetryOverlayToggle.setText(mexBathimetryToggleOffText);
- }
- }
- });
+ // private final GTileLayerOverlay mexBathimetryOverlay = new
+ // GTileLayerOverlay(
+ // mexBathimetryMap);
+ // private final Button mexBathimetryOverlayToggle = new Button(
+ // mexBathimetryToggleOffText, new ClickListener() {
+ // private boolean mexBathimetryShowing = false;
+ //
+ // public void onClick(Widget sender) {
+ // mexBathimetryShowing = !mexBathimetryShowing;
+ // if (mexBathimetryShowing) {
+ // gMap.addOverlay(mexBathimetryOverlay);
+ // mexBathimetryOverlayToggle.setText(mexBathimetryToggleOnText);
+ // } else {
+ // gMap.removeOverlay(mexBathimetryOverlay);
+ // mexBathimetryOverlayToggle.setText(mexBathimetryToggleOffText);
+ // }
+ // }
+ // });
/**
* Button to query for placenames.
*/
@@ -207,27 +210,28 @@
private final GControl scaleControl = GControl.GScaleControl();
private boolean showOverlays = true;
private final WMSTileLayer topoMap = new WMSTileLayer(
- "http://terraservice.net/ogcmap.ashx?", // baseURL
- "drg", // layers
- 4, // minResolution
- 17); // maxResolution
+ "http://msrmaps.com/ogcmap.ashx?", // baseURL
+ // defunct "http://terraservice.net/ogcmap.ashx?", // baseURL
+ "drg", // layers
+ 4, // minResolution
+ 17); // maxResolution

private final GTileLayerOverlay topoOverlay = new
GTileLayerOverlay(topoMap);
private final Button topoOverlayToggle = new Button(topoToggleOffText,
- new ClickListener() {
- private boolean topoShowing = false;
-
- public void onClick(Widget sender) {
- topoShowing = !topoShowing;
- if (topoShowing) {
- gMap.addOverlay(topoOverlay);
- topoOverlayToggle.setText(topoToggleOnText);
- } else {
- gMap.removeOverlay(topoOverlay);
- topoOverlayToggle.setText(topoToggleOffText);
- }
- }
- });
+ new ClickListener() {
+ private boolean topoShowing = false;
+
+ public void onClick(Widget sender) {
+ topoShowing = !topoShowing;
+ if (topoShowing) {
+ gMap.addOverlay(topoOverlay);
+ topoOverlayToggle.setText(topoToggleOnText);
+ } else {
+ gMap.removeOverlay(topoOverlay);
+ topoOverlayToggle.setText(topoToggleOffText);
+ }
+ }
+ });
private final GControl typeControl = GControl.GMapTypeControl();
/**
* the place to put your widgets for the map
@@ -236,7 +240,7 @@

private GeorefMarker activatedMarker = null;
private final GControlPosition userControlsPosition = new
GControlPosition(
- GControlAnchor.G_ANCHOR_TOP_RIGHT(), new GSize(5, 25));
+ GControlAnchor.G_ANCHOR_TOP_RIGHT(), new GSize(5, 25));
private EditRadiusState currentEditRadiusMarker = null;
private EditRadiusState lastSavedEditRadius = null;

@@ -245,9 +249,9 @@
gMap = mapWidget.getGmap();

topoMap.setOpacity(TOPO_LAYER_OPACITY);
- mexBathimetryMap.setOpacity(MEXBATHIMETRY_LAYER_OPACITY);
-
- userControls.add(mexBathimetryOverlayToggle);
+ // mexBathimetryMap.setOpacity(MEXBATHIMETRY_LAYER_OPACITY);
+
+ // userControls.add(mexBathimetryOverlayToggle);
userControls.add(gadmOverlayToggle);
userControls.add(topoOverlayToggle);
// defaultMapType = gMap.getCurrentMapType();
@@ -351,7 +355,7 @@
}
}
((Button) sender).setText(showOverlays == true ? "Hide Uncertainties"
- : "Show Uncertainties");
+ : "Show Uncertainties");
}
}

@@ -362,8 +366,7 @@

public void onLoad(Widget sender) {
if (sender instanceof LoadsGeorefResponse) {
- GeorefResponse response = (((LoadsGeorefResponse) sender)
- .getGeorefResponse());
+ GeorefResponse response = (((LoadsGeorefResponse)
sender).getGeorefResponse());
loadGeorefResponse(response);
}
}
@@ -374,7 +377,7 @@
int newMapWidth = width - absoluteLeft - 10;
int newMapHeight = height - absoluteTop - 10;
((AbsolutePanel) mapWidget.getParent()).setWidgetPosition(mapWidget,
- absoluteLeft, absoluteTop);
+ absoluteLeft, absoluteTop);
mapWidget.setPixelSize(newMapWidth, newMapHeight);
updateMapBounds();
}
@@ -496,8 +499,8 @@
}

private GeorefMarker getGeorefMarker(Georef g, int i) {
- return new GeorefMarker(g.getID(), i, g.getInterpretedLocality(), g
- .getLat(), g.getLng(), g.getUncertaintyRadius(), this);
+ return new GeorefMarker(g.getID(), i, g.getInterpretedLocality(),
+ g.getLat(), g.getLng(), g.getUncertaintyRadius(), this);
}

private void loadGeorefResponse(GeorefResponse response) {
@@ -508,9 +511,9 @@
if (cmarker != null && cmarker.isDeleted() == false) {
cmarker.delete();
}
- CreationMarker createMarker = new CreationMarker(response
- .getCreateRequest(), lat, lon, DEFAULT_UNCERTAINTY_RADIUS,
this,
- response.getRecID());
+ CreationMarker createMarker = new CreationMarker(
+ response.getCreateRequest(), lat, lon,
DEFAULT_UNCERTAINTY_RADIUS,
+ this, response.getRecID());
loadListeners.fireLoad(mapWidget);
addCreationMarkerOverlays(createMarker);
cmarker = createMarker;
=======================================
--- /branches/topos/src/org/biogeomancer/client/ui/WMSTileLayer.java Mon
Sep 17 10:39:52 2007
+++ /branches/topos/src/org/biogeomancer/client/ui/WMSTileLayer.java Wed
Oct 12 23:46:08 2011
@@ -16,16 +16,16 @@

package org.biogeomancer.client.ui;

-import java.util.HashMap;
-import java.util.Iterator;
-
import com.mapitz.gwt.googleMaps.client.GCopyrightCollection;
+import com.mapitz.gwt.googleMaps.client.GLatLng;
import com.mapitz.gwt.googleMaps.client.GMercatorProjection;
import com.mapitz.gwt.googleMaps.client.GPoint;
-import com.mapitz.gwt.googleMaps.client.GLatLng;
import com.mapitz.gwt.googleMaps.client.GTileLayer;
import com.mapitz.gwt.googleMaps.client.JSObject;

+import java.util.HashMap;
+import java.util.Iterator;
+
/**
* To be used as a GTileLayer in com.mapitz.gwt.googleMaps
*
@@ -39,54 +39,51 @@
private String layers = "";
private String lSRS = "";
private String lBbox = "";
-
+
// the following 2 instance variables are accessed from
configureWMSTileLayer
private boolean isPng = false;
private double opacity = 1.0;
-
+
/**
- * String->String dictionary of options to be appended to the URL
returned by getTileUrl
- * Defaults are set in setDefaultOptions()
+ * String->String dictionary of options to be appended to the URL
returned by
+ * getTileUrl Defaults are set in setDefaultOptions()
*/
- private HashMap options = new HashMap();
-
- private void setDefaultOptions() {
- options.put("REQUEST", "GetMap");
- options.put("SERVICE", "WMS");
- options.put("VERSION", "1.1.1");
- options.put("FORMAT", "image/gif");
- options.put("BGCOLOR", "0xFFFFFF");
- options.put("TRANSPARENT", "TRUE");
- options.put("WIDTH", "256");
- options.put("HEIGHT", "256");
- options.put("REASPECT", "FALSE");
- options.put("STYLES", "");
- }
-
- public void setOption(String key, String value) {
- options.put(key, value);
- }
-
- public void unsetOption(String key) {
- options.remove(key);
- }
-
+ private final HashMap options = new HashMap();
+
private static final float WGS84_SEMI_MAJOR_AXIS = (float) 6378137.0;
+
private static final float WGS84_ECCENTRICITY = (float)
0.0818191913108718138;
+
private static final float DEG2RAD = (float) 0.0174532922519943;
+
private static final float PI = (float) 3.14159267;

+ /**
+ * sets up the tile layer's getTileUrl, isPng, and getOpacity methods
+ */
+ private static native void configureWMSTileLayer(JSObject layer,
+ WMSTileLayer wms)
+ /*-{
+ layer.getTileUrl = function(t,z) {
+ return
wms.@org.biogeomancer.client.ui.WMSTileLayer::getTileUrl(III)(t.x,t.y,z);
+ };
+ layer.isPng = function() {
+ return wms.@org.biogeomancer.client.ui.WMSTileLayer::isPng;
+ };
+ layer.getOpacity = function() {
+ return wms.@org.biogeomancer.client.ui.WMSTileLayer::opacity;
+ };
+ }-*/;
+
/**
* Returns the Y Mercator position given Decimal Latitude
*/
private static double dd2MercMetersLat(double lat) {
double lat_rad = lat * DEG2RAD;
- return (WGS84_SEMI_MAJOR_AXIS * Math
- .log(Math.tan((lat_rad + PI / 2) / 2)
- * Math
- .pow(
- ((1 - WGS84_ECCENTRICITY * Math.sin(lat_rad)) / (1 +
WGS84_ECCENTRICITY
- * Math.sin(lat_rad))), (WGS84_ECCENTRICITY / 2))));
+ return (WGS84_SEMI_MAJOR_AXIS * Math.log(Math.tan((lat_rad + PI / 2) /
2)
+ * Math.pow(
+ ((1 - WGS84_ECCENTRICITY * Math.sin(lat_rad)) / (1 +
WGS84_ECCENTRICITY
+ * Math.sin(lat_rad))), (WGS84_ECCENTRICITY / 2))));
}

/**
@@ -97,7 +94,63 @@
}

/**
- * This method is intended to be called using JSNI (JavaScript Native
Interface)
+ * Constructs a new instance with given copyrights
+ */
+ public WMSTileLayer(String baseURL, String layers,
+ GCopyrightCollection copyrights, int minResolution, int
maxResolution) {
+ super(copyrights, minResolution, maxResolution);
+
+ setDefaultOptions();
+ setBaseURL(baseURL);
+ setLayers(layers);
+
+ configureWMSTileLayer(getJSObject(), this);
+ }
+
+ /**
+ * Constructs a new instance with no copyrights
+ */
+ public WMSTileLayer(String baseURL, String layers, int minResolution,
+ int maxResolution) {
+ this(baseURL, layers, new GCopyrightCollection(), minResolution,
+ maxResolution);
+ }
+
+ public String getBaseURL() {
+ return baseURL;
+ }
+
+ public String getLayers() {
+ return layers;
+ }
+
+ public void setBaseURL(String baseURL) {
+ this.baseURL = baseURL;
+ }
+
+ public void setLayers(String layers) {
+ this.layers = layers;
+ }
+
+ public void setOpacity(double opacity) {
+ this.opacity = opacity;
+ }
+
+ public void setOption(String key, String value) {
+ options.put(key, value);
+ }
+
+ public void setPng(boolean isPng) {
+ this.isPng = isPng;
+ }
+
+ public void unsetOption(String key) {
+ options.remove(key);
+ }
+
+ /**
+ * This method is intended to be called using JSNI (JavaScript Native
+ * Interface)
*/
protected String getTileUrl(int x, int y, int zoom) {
setBBOX(new GPoint(x, y), zoom);
@@ -106,8 +159,8 @@
lURL += "BBOX=" + lBbox + "&";
lURL += "LAYERS=" + layers + "&";
for (Iterator i = options.keySet().iterator(); i.hasNext();) {
- String key = (String)i.next();
- String val = (String)options.get(key);
+ String key = (String) i.next();
+ String val = (String) options.get(key);
lURL += key + "=" + val + "&";
}
if (lURL.endsWith("&")) {
@@ -119,8 +172,8 @@
}

/**
- * Gets the Bounding Box and SRS for this WMS Call,
- * saving them in instance variables lBbox and lSRS
+ * Gets the Bounding Box and SRS for this WMS Call, saving them in
instance
+ * variables lBbox and lSRS
*/
private void setBBOX(GPoint point, int zoom) {
GPoint lULP = new GPoint(point.getX() * 256, (point.getY() + 1) * 256);
@@ -140,63 +193,16 @@
}
}

- /**
- * sets up the tile layer's getTileUrl, isPng, and getOpacity methods
- */
- private static native void configureWMSTileLayer(JSObject layer,
WMSTileLayer wms)
- /*-{
- layer.getTileUrl = function(t,z) {
- return
wms.@org.biogeomancer.client.ui.WMSTileLayer::getTileUrl(III)(t.x,t.y,z);
- };
- layer.isPng = function() {
- return wms.@org.biogeomancer.client.ui.WMSTileLayer::isPng;
- };
- layer.getOpacity = function() {
- return wms.@org.biogeomancer.client.ui.WMSTileLayer::opacity;
- };
- }-*/;
-
- /**
- * Constructs a new instance with no copyrights
- */
- public WMSTileLayer(String baseURL, String layers, int minResolution,
int maxResolution) {
- this(baseURL, layers, new GCopyrightCollection(), minResolution,
maxResolution);
- }
-
- /**
- * Constructs a new instance with given copyrights
- */
- public WMSTileLayer(String baseURL, String layers, GCopyrightCollection
copyrights, int minResolution, int maxResolution) {
- super(copyrights, minResolution, maxResolution);
-
- setDefaultOptions();
- setBaseURL(baseURL);
- setLayers(layers);
-
- configureWMSTileLayer(getJSObject(), this);
- }
-
- public String getBaseURL() {
- return baseURL;
- }
-
- public void setBaseURL(String baseURL) {
- this.baseURL = baseURL;
- }
-
- public String getLayers() {
- return layers;
- }
-
- public void setLayers(String layers) {
- this.layers = layers;
- }
-
- public void setPng(boolean isPng) {
- this.isPng = isPng;
- }
-
- public void setOpacity(double opacity) {
- this.opacity = opacity;
+ private void setDefaultOptions() {
+ options.put("REQUEST", "GetMap");
+ options.put("SERVICE", "WMS");
+ options.put("VERSION", "1.1.1");
+ options.put("FORMAT", "image/png");
+ options.put("BGCOLOR", "0xFFFFFF");
+ options.put("TRANSPARENT", "TRUE");
+ options.put("WIDTH", "256");
+ options.put("HEIGHT", "256");
+ options.put("REASPECT", "FALSE");
+ options.put("STYLES", "");
}
}
=======================================
--- /branches/topos/src/org/biogeomancer/public/WorkBench.html Tue May 4
13:40:26 2010
+++ /branches/topos/src/org/biogeomancer/public/WorkBench.html Wed Oct 12
23:46:08 2011
@@ -103,9 +103,10 @@
</table>

<a id="versionLink" style="margin:7px 3px" target="_blank"
href="version.html">Version %VERSION%</a>
-<!-- <a id="appLogsLink" style="margin:7px 3px" target="_blank"
href="log">Application Logs</a>
+<!--
+ <a id="appLogsLink" style="margin:7px 3px" target="_blank"
href="log">Application Logs</a>
-->
- <a id="helpLink" style="margin:7px 3px" target="_blank"
href="http://groups.google.com/group/biogeomancer-workbench-support/web/biogeomancer-workbench-help">Help</a>
+ <a id="helpLink" style="margin:7px 3px" target="_blank"
href="https://sites.google.com/site/biogeomancerworkbench/support">Help</a>
<a id="issueLink" style="margin:7px 3px" target="_blank"
href="http://code.google.com/p/biogeomancer-workbench/issues/entry">Submit
Issue</a>

<script type="text/javascript">

Reply all
Reply to author
Forward
0 new messages