Hi,
I posted a message about this issue a while ago and I still haven't solved the issue. I'm trying to insert an OpenLayers map into my SmartGWT project. I'm using GWT-OpenLayers, which allows me to use an OpenLayers map as a widget. I set the widgets width and height to 100% then add it to a HLayout as follows:
MapWidget mw = createMap("EPSG:4326");
mw.getMap().setMaxExtent(new Bounds(-180, -90, 180, 90));
mw.setWidth("100%");
mw.setHeight("100%");
HLayout mapPanel = new HLayout();
mapPanel.setWidth100();
mapPanel.setHeight100();
mapPanel.addMember(mw);
However, my map doesn't appear on the page. I investigated this using Google Chrome development tools and it seems that the maps parent div has no height (the parent div is <div id="isc_13" eventproxy="isc_WidgetCanvas_0" style="position: relative; visibility: inherit; z-index: 200324; cursor: default; ">). I assume this div is generated by SmartGWT?
When I set the height of the map to a fixed value (like "400px") then it displays. However, any percentage value doesn't work!
I don't understand how this is happening, since I'm setting the HLayout to 100% and setting the MapWidget to 100%.
Any idea how I might solve this issue?
Thanks,
Jon
I posted a message about this issue a while ago and I still haven't solved the issue. I'm trying to insert an OpenLayers map into my SmartGWT project. I'm using GWT-OpenLayers, which allows me to use an OpenLayers map as a widget. I set the widgets width and height to 100% then add it to a HLayout as follows:
MapWidget mw = createMap("EPSG:4326");
mw.getMap().setMaxExtent(new Bounds(-180, -90, 180, 90));
mw.setWidth("100%");
mw.setHeight("100%");
HLayout mapPanel = new HLayout();
mapPanel.setWidth100();
mapPanel.setHeight100();
mapPanel.addMember(mw);
However, my map doesn't appear on the page. I investigated this using Google Chrome development tools and it seems that the maps parent div has no height (the parent div is <div id="isc_13" eventproxy="isc_WidgetCanvas_0" style="position: relative; visibility: inherit; z-index: 200324; cursor: default; ">). I assume this div is generated by SmartGWT?
When I set the height of the map to a fixed value (like "400px") then it displays. However, any percentage value doesn't work!
I don't understand how this is happening, since I'm setting the HLayout to 100% and setting the MapWidget to 100%.
Any idea how I might solve this issue?
Thanks,
Jon
Comment