GWT OpenLayers Bindings
The GWT OpenLayers Bindings library provides GWT language bindings for the openlayers.org mapping software
Project Home: http://code.google.com/p/gwtopenlayers/
Displaying a map is as easy as:
MapWidget map = new MapWidget(true);
map.getMap().addLayer(new Google(Google.TYPE.SATELLITE, "World View", false), true);
map.getMap().addControl(new NavToolBar());
map.getMap().addControl(new PanZoomBar());
final MarkerLayer ml = new MarkerLayer("Icons");
map.getMap().addLayer(ml, false);
map.getMap().setCenter(new LonLat(-98, 40), 5, true, true);
map.getMap().addMapListener(new MapIconManager(ml, map));
RootPanel.get().add(map);
Comments
How does this project compare with the GWT-OpenLayers project on SourceForge:
https://sourceforge.net/projects/gwt-openlayers/
ar vectorLayer = new OpenLayers.Layer.Vector(“Vector”);
var pointList = [];
pointList.push(new OpenLayers.Geometry.Point(lon+0.0100,lat+0.0100).transform(new OpenLayers.Projection(“EPSG:4326″), new OpenLayers.Projection(“EPSG:900913″)));
pointList.push(new OpenLayers.Geometry.Point(lon+0.0200,lat+0.0200).transform(new OpenLayers.Projection(“EPSG:4326″), new OpenLayers.Projection(“EPSG:900913″)));
pointList.push(new OpenLayers.Geometry.Point(lon+0.0300,lat+0.0300).transform(new OpenLayers.Projection(“EPSG:4326″), new OpenLayers.Projection(“EPSG:900913″)));
pointList.push(new OpenLayers.Geometry.Point(lon+0.0400,lat+0.0400).transform(new OpenLayers.Projection(“EPSG:4326″), new OpenLayers.Projection(“EPSG:900913″)));
pointList.push(new OpenLayers.Geometry.Point(lon+0.0500,lat+0.0500).transform(new OpenLayers.Projection(“EPSG:4326″), new OpenLayers.Projection(“EPSG:900913″)));
var lineFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(pointList),
null,{
strokeColor: “#0000DD”,
strokeWidth: 6
});
vectorLayer.addFeatures([lineFeature]);
map.addLayer(vectorLayer);
dont work..
How do I get the open layers plug in started.
Steps I took..
1. downloaded jar GWT-OpenLayers-0.2.jar
2. added following to basic GWT app
public void onModuleLoad() {
MapWidget map = new MapWidget(true);
map.getMap().addLayer(new Google(Google.TYPE.SATELLITE,
“World View”, false), true);
map.getMap().addControl(new NavToolBar());
map.getMap().addControl(new PanZoomBar());
final MarkerLayer ml = new MarkerLayer(“Icons”);
map.getMap().addLayer(ml, false);
map.getMap().setCenter(new LonLat(-98, 40), 5, true, true);
map.getMap().addMapListener(new MapIconManager(ml, map));
RootPanel.get().add(map);
}
3. Ran app and got compile error
Information:Compilation completed with 1 error and 0 warnings
Information:1 error
Information:0 warnings
C:\_work\java\projects\atlas\src\java\aims\app\sci\atlas\gwt\client\Atlas.java
Error:Error:line (5)cannot access
com.gorthaur.franza.openlayers.client.MapWidget
bad class file:
C:\_work\java\projects\atlas\lib\GWT-OpenLayers-0.2.jar(com/gorthaur/franza/openlayers/client/MapWidget.class)
class file has wrong version 50.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the
classpath.
dcrossma Reply:
March 22nd, 2009 at 10:22 pm
fixed but updating project java version to 1.6
Is there an api? How do I implement a WMS Layer? what are the parameters s1,s2,s3 new WMS(s1,s2,s3)
Cheers
Dave
Is this project still operational or should I use https://sourceforge.net/projects/gwt-openlayers/ ?
I am searching for an OpenLayers binding for OpenLayers2.8 and GWT2.0.0
Can you point me to the right place? It seems as if this package stopped being enhanced in the GWT1.5 era.
Many thanks.
pfranza Reply:
January 8th, 2010 at 1:47 pm
I have a newer project that contains working bindings for gwt 2.0 it is basic on the work from https://sourceforge.net/projects/gwt-openlayers/ and aspires to create a map toolkit that will select the best map engine that the use has available and then degrade gracefully from there. I.e. use a flash map like openscales then degrade to openlayers etc..




Can you give an example of how to use MapIconManager?
Reply