List of usage examples for com.google.gwt.maps.client.control LargeMapControl LargeMapControl
public LargeMapControl()
From source file:org.onebusaway.webapp.gwt.where_library.view.StopFinderWidget.java
License:Apache License
/***************************************************************************** * Public Methods//from w ww . j ava 2 s . c o m ****************************************************************************/ public StopFinderWidget() { initWidget(_uiBinder.createAndBindUi(this)); _map.addControl(new LargeMapControl()); _map.addControl(new MapTypeControl()); _map.addControl(new ScaleControl()); _map.setScrollWheelZoomEnabled(true); // We delay initialization of the map Scheduler scheduler = Scheduler.get(); scheduler.scheduleDeferred(new ScheduledCommand() { @Override public void execute() { _map.checkResizeAndCenter(); CoordinateBounds b = _config.getBounds(); LatLng from = LatLng.newInstance(b.getMinLat(), b.getMinLon()); LatLng to = LatLng.newInstance(b.getMaxLat(), b.getMaxLon()); LatLngBounds bounds = LatLngBounds.newInstance(from, to); int zoom = _map.getBoundsZoomLevel(bounds); System.out.println(bounds + " => " + zoom); _map.setZoomLevel(zoom); _map.checkResizeAndCenter(); } }); _transitMapManager.addStopClickedHandler(new StopClickedHandler() { @Override public void handleStopClicked(StopClickedEvent event) { StopBean stop = event.getStop(); InfoWindow window = _map.getInfoWindow(); LatLng point = LatLng.newInstance(stop.getLat(), stop.getLon()); Widget widget = getStopInfoWindowWidget(stop, style); window.open(point, new InfoWindowContent(widget)); } }); }
From source file:org.opennms.features.poller.remote.gwt.client.GoogleMapsPanel.java
License:Open Source License
private void initializeMapPanel() { getMapWidget().setSize("100%", "100%"); getMapWidget().setUIToDefault();//from w w w.java 2 s .c o m getMapWidget().addControl(new LargeMapControl()); getMapWidget().setScrollWheelZoomEnabled(true); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(final ResizeEvent resizeEvent) { if (getMapWidget() != null) { getMapWidget().checkResizeAndCenter(); } } }); }
From source file:org.ow2.aspirerdfid.tracking.demo.client.TrackingDemo.java
License:Open Source License
protected void buildUi() { LatLng AthensCity = LatLng.newInstance(37.58, 23.43); map = new MapWidget(AthensCity, 2); map.setSize("100%", "100%"); // Add some controls for the zoom level map.addControl(new LargeMapControl()); map.setScrollWheelZoomEnabled(true); // // Add a marker // map.addOverlay(new Marker(AthensCity)); mainPanel.add(map);// w w w .j a va2s . c o m // Create a base icon for all of our markers that specifies the // shadow, icon dimensions, etc. baseIcon = Icon.newInstance(); baseIcon.setShadowURL("http://google-maps-icons.googlecode.com/files/shadow.png"); baseIcon.setIconSize(Size.newInstance(20, 34)); baseIcon.setShadowSize(Size.newInstance(37, 34)); baseIcon.setIconAnchor(Point.newInstance(9, 34)); baseIcon.setInfoWindowAnchor(Point.newInstance(9, 2)); }
From source file:org.yocto.sample.client.WorldMap.java
License:Open Source License
private void buildUi() { logger.info("Build UI"); //Note: that in order to get locations and markers: the MAP api must be loaded first. createCallbacks();//from ww w. ja v a 2 s.c o m LatLng cartigny = LatLng.newInstance(46.1833, 6.0167); map = new MapWidget(cartigny, 2); map.setSize("100%", "100%"); // Add some controls for the zoom level map.addControl(new LargeMapControl()); final DockLayoutPanel dock = new DockLayoutPanel(Style.Unit.PX); dock.addNorth(map, 500); RootPanel.get("worldMap").add(dock); // Add the map to the HTML host page }