public void resizeTo(int width, int height) { mapWidget.setHeight(height + "px"); mapWidget.setWidth(width + "px"); this.width = width; this.height = height; }
/** * Programmatically creates the element that will contain the map, * with the given width and height. * * The map itself is instantiated upon calling {@link #getMap()}. * * @param width - a String with the width of the element that will contain the map in CSS units. * @param height - a String with the height of the element that will contain the map in CSS units. * @param options - null if no options should be set upon map instantiation * or a MapOptions object that is passed to the map upon instantiation. * * @since GWT-OL 0.2 */ public MapWidget(String width, String height, MapOptions options) { Element e = DOM.createDiv(); this.options = options; setElement(e); setWidth(width); setHeight(height); }
/** * Programmatically creates the element that will contain the map, with the * given width and height. * * The map itself is instantiated upon calling {@link #getMap()}. * * @param width - a String with the width of the element that will contain * the map in CSS units. * @param height - a String with the height of the element that will contain * the map in CSS units. * @param options - null if no options should be set upon map instantiation * or a MapOptions object that is passed to the map upon instantiation. * * @since GWT-OL 0.2 */ public MapWidget(String width, String height, MapOptions options) { Element e = DOM.createDiv(); this.options = options; setElement(e); setWidth(width); setHeight(height); }