OpenLayers 2 add-on for Vaadin 7 is here

For those of us who cannot upgrade to OL3 there is now an OL2 add-on! Get it at https://vaadin.com/directory#!addon/openlayers-2-add-on

Hi! As I’ve already mentioned, it’s a great job. But I still can’t get the ImageLayer work.
Here is the code snippet:

// Initialize our new UI component
final OpenLayersMap map = new OpenLayersMap();
map.setApiProjection("EPSG:4326");
map.setSizeFull();
ImageLayer osmLayer = new ImageLayer("http://www.hd-wallpapersdownload.com/upload/bulk-upload/desktop-high-resolution-wallpaper-nature-dowload.jpg", 1920, 1024);
// smLayer.setSizeFull();
map.addLayer(osmLayer);
map.setBaseLayer(osmLayer);
map.setCenter(960, 512);
map.setZoom(1);
setContent(map);

Am I doing smth worng? Or how can I work with static image like with map? I mean I need all stuff we have with maps like zooming with wheel etc, but on static image. Mant thanks in advance.

Is your image geo-referenced? By the URL I highly doubt it thus there is no point in using this add-on for your use case. Only geo-referenced images such as GeoTIFFs, certain JPEGs, etc. will respond to what you are wanting to do.

Ah, I see. Of course no, it’s not geo-referenced, it’s the first I’ve got in google.
I’m trying this one http://dev.openlayers.org/examples/image-layer.html and seems you should add the geo-referenced layer, but the url can be empty. and also this example, but openlayers3, http://openlayers.org/en/v3.2.0/examples/static-image.html, here we even don’t have any references. So, I guess it could be possible to do what I want.

Anyway thanks for reply :slight_smile:

The second example uses a custom projection which is not possible with the current add-on so that would not work for you. Have you tried the OL3 add-on? It may support what you want.

I will. Thanks a lot.

Hi, It smees that clickListener and setCaption doesn`t work for Markers. Can you fix it?
Kind regards!

ClickListener works fine for markers as I use it myself. Not sure about the caption though as I’m not the original author. I don’t have the bandwidth to work on the add-on at the moment but pull requests are always welcome.