OpenLayers Wrapper now supports drawing areas

Hi,

I finally found some time to push on with my hobby projects - related to maps of course. I practically rewrote the client side of the openlayers wrapper so that it doesn’t use gwt-openlayers module anymore. I faced some issues with it and didn’t like its design when I tried to hack with it. The new GWT api around openlayers is now built with JavaScript Overlays and should be easier for developers to extend and debug. If I’d build a pure GWT app, I’d actually start with that module rather than the gwt-openlayers :wink:

The new version is available in the
Directory
and there is also a bit more sophisticated
example
available (a simple KML editor, source code available in google code).

cheers,
matti

Hi Matti,

I’m new of Vaadin and i’m trying to put your add-on in my web application.
I extracted from the example, that you have published on svn, the FeatureMap class and i put it as vaadin Component inside a vaadin Panel of my application. I inserted the jar in the WEB-INF/lib folder, i added plugins and dependencies to my project pom and maven compile correctly the widgetset.
The result of this work is that my web page displays the message:

Widgetset does not contain implementation for org.vaadin.vol.OpenLayersMap. Check its @ClientWidget mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions. Unrendered UIDL:
org.vaadin.vol.OpenLayersMap(NO CLIENT IMPLEMENTATION FOUND)

Maybe i should realize client side classes, but i have no idea how i could do it and i didn’t find these classes in your example. Can you help me?

(Without knowing this particular add-on: )

Maven does not really use JARs in WEB-INF/lib on its compilation classpath, so I suspect your widgetset does not include that widget (see widgetset the compilation results, which widgets were included). You should instead include a Maven dependency to the
OpenLayers wrapper add-on
(see the POM sections on the right) as well as to any libraries needed by it (see the directory page, or any readme text or similar).

If you do see your component listed among the ones Maven GWT compilation includes in the widgetset, your web.xml might be missing a reference to the widgetset.

Hi Marco,

I’d bet Henri answered correctly. For some reason widgets from open layers wrapper don’t get included in your widgetset. How are you compiling your widgetset? If you are already using maven, it is probably easiest to use maven as described in Directory’s help page:


addon instructions for maven users

cheers,
matti

Matti,

I’m interested in trying out your plug-in, but I’m having trouble getting started. I add the GoogleStreeMap and OpenStreetMap layers, but I just get a blank viewport with controls on the side. There aren’t any errors, so I’m not sure what I’m doing wrong.

I tried to copy
the example from the source repository
, but I get the same thing. I’m using version 0.4.0.

Is there a minimal example of the OpenLayers Wrapper that I could use as a starting-point?

Hi,

Threre is quite a lot of moving parts in these web mapping solutions. If you see the map controls etc the issue is probably with your base maps. WMS and TMS layers work out of the box, but both Google Maps and OpenStreetMap needs some extra javascript to be injected to the host page.

As not everybody is using those so open layers wrapper don’t add them automatically. Also it may depend your hosting solutions (vaadin servlet, existing web page, portal…) how you want to include it. As you need to GWT compile your widgetset the easiest method is probably to add script tag to your widgetsets .gwt.xml file (aka GWT module description file). Check this example:


Example widgetset that includes google map js api

That
whole project
may be a good starting point for testing. It should be rather easy to start with if you are familiar with maven.

BTW. I just noticed that vol wrappers don’t work properly in all configurations in FF if firebug is not active :frowning: Will give an eye on it next time I play with this project.

cheers,
matti

This was part of the problem. Swapping GSM and OSM for WMS didn’t make any difference if FF (even after updating to 0.5.2 and recompiling the widget). Using Safari, I got the triangle, vaadin logo, and a bunch of missing image markers.

I can get the vkml project to build a WAR which works (even in FF), but I’ve never used Maven before and haven’t been able to figure out how to get the near-instant build/deploy development cycle that I enjoy with Vaadin.

If your code is in a single project, you can just run it the same way you are used to (under Eclipse, install the m2eclipse tool with its WTP integration). You can then “Run on server” or “Debug on server” just like you are used to.

You can also run Jetty under Maven: it is a) faster to start and b) there is a handy extraClasspath feature that allows you to hotswap your code (seldom stopping the container) even if you have several jars in separate projects and you are editing the source all over.

I also installed DCEVM (a nice free project, an alternative to the commercial JRebel), which allows you to keep editing even when you change inner classes or define new variables, most of the time.

That sound like exactly what I want. Can you provide some more explicit details or a pointer to a simple example? I don’t have a strong grasp of web services stuff yet.

I had installed m2eclipse when I tried the vkml project. m2eclipse was able to download the required jars, but I couldn’t figure out how to build or deploy anything with it. I had to use the command line mvn tool to build the WAR, and deploy it manually.

Hi,

I’ve also had some issues with m2eclipse and WTP integration. I’d probably need a course on maven and m2eclipse. That (the way JF instructed) is how I would like to use it, but then got bored fighting with irrelevant issues. I even tried to switch to NetBeans, but I had too much to real work to do at that point. In my latest maven based projects I have used a simple jetty dependency and launcher in the test scope. Then I just launch the app into debug mode with F11 like any simple java app. Not so academic solution but works like a charm:

http://code.google.com/p/vkml/source/browse/trunk/vkml/src/test/java/TestServer.java

The FF issue should be resolved in 0.5.2. (the KML editor uses that version). If you still got issues with it, please let me know.

cheers,
matti

Matti is right, there are lots of irrelevant details to fight against.
I have a pair of projects that might fit the bill as an example, I will look at making the Eclipse projects available.

Matti is right, there are lots of irrelevant details to fight against.
I have a pair of projects that might fit the bill as an example, I will look at making the Eclipse projects available.

Hi Matti,
I am very satisfied of your plugin. Now i have a problem. I need to recover the position after a click on map. The scenario is the following: the user click with the mouse on the map, a popup that shows the relative position with longitude and latitude values appears.

How can i realize this? I would need a click listener on a layer, and from the relative event i should recover the position(geolocated) associated to the click.

Thank you very much!

Sounds like similar functionality to how the Vector Layer adds new Points. You could look into how the position is stored from the drawing listener and perhaps implement your own in a similar fashion.