Hello,
We currently have a vaadin application that uses the google map add-on. Everything is working ok, but we want to move to the OpenLayers add-on to be able to use the google maps api v3.
The application can be embedded in other websites using an iframe. The problem is now that the OpenLayers add-on refuses to work inside a iframe. This can be reproduced very easily by creating a very simple OpenLayers application with the google maps layers :
public class MapApplication extends Application {
@Override
public void init() {
Window mainWindow = new Window("Map Application");
setMainWindow(mainWindow);
final OpenLayersMap map = new OpenLayersMap();
GoogleStreetMapLayer googleStreets = new GoogleStreetMapLayer();
map.addLayer(googleStreets);
map.setCenter(22.30083, 60.452541);
map.setWidth("300px");
map.setHeight("300px");
mainWindow.addComponent(map);
}
}
Now, when using this application on itself in a browser window, everything works fine.
But, when trying to show the application inside an iframe, no map is shown :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<iframe src="http://localhost:8080/Map" height="500" width="500"></iframe>
</body>
</html>
Any ideas what could be causing this?
Thanks in advance.