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

Can you give an example of how to use MapIconManager?

Reply

How does this project compare with the GWT-OpenLayers project on SourceForge:
https://sourceforge.net/projects/gwt-openlayers/

Reply

I think your map is pretty sexy.

Reply

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..

Reply

pfranza Reply:

This project is about GWT bindings, so I can only answer to the usage of openlayers through GWT. Your code is written in straight javascript and would be more suited for posting on the Openlayers forum.

Reply

how can i do javascript sample in gwt?

Reply

how can i do javascript sample in gwt with your project … is not possible to draw in any way?

Reply

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.

Reply

dcrossma Reply:

fixed but updating project java version to 1.6

Reply

pfranza Reply:

yes sorry the jars I’ve released are java 6, however I do not think that I used any constructs that would not work under java 5, you would just have to compile the jars yourself from source.

Reply

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

Reply

pfranza Reply:

The three arguments are [String name, String url, String options] and they map 1:1 with the openlayers API $wnd.OpenLayers.Layer.WMS(name, url, options);

Reply

Is this project still operational or should I use https://sourceforge.net/projects/gwt-openlayers/ ?

Reply

pfranza Reply:

The project is still active, however its a function of my time/need. There have been a few community contributions. The sourceforge project hasn’t put out a release in 14 months.

Reply

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.

Reply

pfranza Reply:

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..

Reply

Leave a comment

(required)

(required)