List of usage examples for com.google.gwt.maps.client.control LargeMapControl LargeMapControl
public LargeMapControl()
From source file:at.ait.dme.yuma.client.map.annotation.GoogleMapsComposite.java
License:EUPL
private void showMap() { initWidget(compositePanel);/* ww w.ja va 2 s . com*/ parseBoundingBox(); this.setStyleName("mapAnnotation-composite"); // show GMap map.addControl(new LargeMapControl()); map.setSize("500px", "300px"); map.setZoomLevel(3); map.setScrollWheelZoomEnabled(true); map.setDraggable(true); createMapOverlays(); compositePanel.add(map); if (Application.isInTileMode()) { Anchor kmlLink = new Anchor(Application.getConstants().kmlExport(), createKmlLink()); kmlLink.setStyleName("mapAnnotation-kml"); compositePanel.add(kmlLink, 10, 240); } }
From source file:at.ait.dme.yuma.suite.apps.map.client.widgets.GoogleMapsComposite.java
License:EUPL
private void showMap() { initWidget(compositePanel);/* w w w. j a v a2 s. c o m*/ this.setStyleName("mapAnnotation-composite"); // show GMap map.addControl(new LargeMapControl()); map.setSize("500px", "300px"); map.setZoomLevel(3); map.setScrollWheelZoomEnabled(true); map.setDraggable(true); createMapOverlays(); compositePanel.add(map); Anchor kmlLink = new Anchor(YUMACoreProperties.getConstants().kmlExport(), createKmlLink()); kmlLink.setStyleName("mapAnnotation-kml"); compositePanel.add(kmlLink, 10, 240); }
From source file:com.claudiushauptmann.gwt.maps.gxt.samples.client.OverlayEditor.java
License:Apache License
public void onModuleLoad() { // Map//from w ww .j av a2s . c om mapWidget = new MapWidget(); mapWidget.setCenter(LatLng.newInstance(48.136559, 11.576318), 13); mapWidget.setWidth("100%"); mapWidget.setHeight("100%"); mapWidget.addControl(new LargeMapControl()); mapWidget.setContinuousZoom(true); mapWidget.setScrollWheelZoomEnabled(true); RootPanel.get().add(mapWidget); // MapController mapGxtController = new MapGXTController(mapWidget); mapMenuProvider = new MapMenuProvider(); mapGxtController.setMenuProvider(mapMenuProvider); // Marker MarkerOptions mo = MarkerOptions.newInstance(); mo.setClickable(true); mo.setDraggable(true); Marker marker = new Marker(mapWidget.getCenter(), mo); mapWidget.addOverlay(marker); new MyMarkerEditController(mapGxtController, marker, "Marienplatz", "Marienplatz is a central square in the" + " city center of Munich, Germany since 1158.<br/>" + " In the Middle Ages markets and tournaments were held in this" + " city square. The Glockenspiel in the new city hall was inspired" + " by these tournaments, and draws millions of tourists a year."); // Polyline LatLng[] llline = new LatLng[3]; llline[0] = LatLng.newInstance(48.131955, 11.527061); llline[1] = LatLng.newInstance(48.11809, 11.579247); llline[2] = LatLng.newInstance(48.127143, 11.638298); PolylineOptions plo = PolylineOptions.newInstance(true, false); Polyline line = new Polyline(llline, "#FF0000", 2, 1.0, plo); mapWidget.addOverlay(line); new MyPolylineEditController(mapGxtController, line, "Polyline", "This is a polyline."); // Polygon LatLng[] llpolygon = new LatLng[4]; llpolygon[0] = LatLng.newInstance(48.119809, 11.539936); llpolygon[1] = LatLng.newInstance(48.158185, 11.541138); llpolygon[2] = LatLng.newInstance(48.155894, 11.569118); llpolygon[3] = llpolygon[0]; PolygonOptions pgo = PolygonOptions.newInstance(true); Polygon polygon = new Polygon(llpolygon, "#0000FF", 2, 1.0, "#0000FF", 0.3, pgo); mapWidget.addOverlay(polygon); new MyPolygonEditController(mapGxtController, polygon, "Polygon", "This is a polygon."); }
From source file:com.google.gwt.maps.sample.hellomaps.client.GeoRssOverlayDemo.java
License:Apache License
public GeoRssOverlayDemo() { Panel panel = new FlowPanel(); map = new MapWidget(LatLng.newInstance(49.496675, -102.65625), 3); map.setSize("640px", "480px"); map.addControl(new LargeMapControl()); panel.add(map);/* w w w . j a v a2 s . com*/ toggleButton = new Button("Toggle Markers"); toggleButton.setEnabled(false); toggleButton.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (geoXml == null) { return; } if (geoXmlShown) { map.removeOverlay(geoXml); } else { map.addOverlay(geoXml); } geoXmlShown = !geoXmlShown; } }); panel.add(toggleButton); initWidget(panel); GeoXmlOverlay.load( "http://api.flickr.com/services/feeds/groups_pool.gne?id=322338@N20&format=rss_200&georss=1", new GeoXmlLoadCallback() { @Override public void onFailure(String url, Throwable e) { StringBuffer message = new StringBuffer("GeoRss File " + url + " failed to load"); if (e != null) { message.append(e.toString()); } Window.alert(message.toString()); } @Override public void onSuccess(String url, GeoXmlOverlay overlay) { geoXml = overlay; toggleButton.setEnabled(true); map.addOverlay(geoXml); GWT.log("GeoRss File " + url + "loaded successfully", null); GWT.log("Default Center=" + geoXml.getDefaultCenter(), null); GWT.log("Default Span=" + geoXml.getDefaultSpan(), null); GWT.log("Default Bounds=" + geoXml.getDefaultBounds(), null); GWT.log("Supports hide=" + geoXml.supportsHide(), null); } }); }
From source file:com.google.gwt.maps.sample.hellomaps.client.KmlOverlayDemo.java
License:Apache License
public KmlOverlayDemo() { Panel panel = new FlowPanel(); map = new MapWidget(LatLng.newInstance(41.875696, -87.624207), 11); map.setSize("640px", "480px"); map.addControl(new LargeMapControl()); panel.add(map);/* w w w .j a va2s. c om*/ // Toggle the visibility of the overlays by // adding and removing the overlay. removeAddButton = new Button("Remove/Add KML"); // Toggle the visibility of the overlays // using the show() and hide() methods final Button showHideButton = new Button("Show/Hide KML"); removeAddButton.setEnabled(false); removeAddButton.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (geoXml == null) { return; } if (geoXmlShown) { map.removeOverlay(geoXml); showHideButton.setEnabled(false); } else { map.addOverlay(geoXml); showHideButton.setEnabled(true); } geoXmlShown = !geoXmlShown; } }); panel.add(removeAddButton); showHideButton.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (geoXml == null) { return; } if (geoXml.isHidden()) { geoXml.setVisible(true); } else { geoXml.setVisible(false); } } }); panel.add(showHideButton); initWidget(panel); GeoXmlOverlay.load("http://mapgadgets.googlepages.com/cta.kml", new GeoXmlLoadCallback() { @Override public void onFailure(String url, Throwable e) { StringBuffer message = new StringBuffer("KML File " + url + " failed to load"); if (e != null) { message.append(e.toString()); } Window.alert(message.toString()); } @Override public void onSuccess(String url, GeoXmlOverlay overlay) { geoXml = overlay; removeAddButton.setEnabled(true); showHideButton.setEnabled(true); map.addOverlay(geoXml); GWT.log("KML File " + url + "loaded successfully", null); GWT.log("Default Center=" + geoXml.getDefaultCenter(), null); GWT.log("Default Span=" + geoXml.getDefaultSpan(), null); GWT.log("Default Bounds=" + geoXml.getDefaultBounds(), null); GWT.log("Supports hide=" + geoXml.supportsHide(), null); } }); }
From source file:com.google.gwt.maps.sample.hellomaps.client.MapTypeDemo.java
License:Apache License
public MapTypeDemo() { VerticalPanel vertPanel = new VerticalPanel(); vertPanel.setStyleName("hm-panel"); map = new MapWidget(LatLng.newInstance(37.4419, -122.1419), 13); map.setSize("500px", "500px"); // Add in all the map types we know about. for (MapType mt : MapType.getDefaultMapTypes()) { map.addMapType(mt);//w w w.ja v a2 s . c o m } map.addMapType(MapType.getPhysicalMap()); map.addMapType(MapType.getEarthMap()); for (MapType mt : MapType.getMoonMapTypes()) { map.addMapType(mt); } for (MapType mt : MapType.getMarsMapTypes()) { map.addMapType(mt); } for (MapType mt : MapType.getSkyMapTypes()) { map.addMapType(mt); } map.addControl(new DemoCustomMapTypeControl()); map.addControl(new LargeMapControl()); vertPanel.add(map); initWidget(vertPanel); }
From source file:com.google.gwt.maps.sample.hellomaps.client.RoutedDirectionsDemo.java
License:Apache License
public RoutedDirectionsDemo() { final Grid grid = new Grid(1, 2); grid.setWidth("100%"); grid.getCellFormatter().setWidth(0, 0, "64%"); grid.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP); grid.getCellFormatter().setWidth(0, 1, "34%"); grid.getCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP); map = new MapWidget(ATLANTA, 15); map.setHeight("480px"); map.addControl(new LargeMapControl()); grid.setWidget(0, 0, map);/*from ww w. jav a 2 s . c o m*/ DirectionsPanel directionsPanel = new DirectionsPanel(); grid.setWidget(0, 1, directionsPanel); directionsPanel.setSize("100%", "100%"); initWidget(grid); DirectionQueryOptions opts = new DirectionQueryOptions(map, directionsPanel); // Create directions from Midtown Atlanta to the Airport with a *few* // stops along the way. Directions.loadFromWaypoints(waypoints, opts, new DirectionsCallback() { public void onFailure(int statusCode) { Window.alert( "Failed to load directions: Status " + StatusCodes.getName(statusCode) + " " + statusCode); } public void onSuccess(DirectionResults result) { GWT.log("Successfully loaded directions.", null); // A little exercise of the route API List<Route> routes = result.getRoutes(); for (Route r : routes) { Placemark start = r.getStartGeocode(); GWT.log("start of route: " + start.getAddress(), null); Placemark end = r.getEndGeocode(); GWT.log("end of route: " + end.getAddress(), null); } } }); }
From source file:org.onebusaway.webapp.gwt.oba_application.OneBusAwayStandardApplication.java
License:Apache License
@Override public void onModuleLoad() { HistoryContextManager manager = new HistoryContextManager(); ModelEventsSourceAndSink events = new ModelEventsImpl(); ModelEventSourceAndSink<LocationQueryModel> locationQueryModelEvents = events .getEventSourceAndSink(LocationQueryModel.class); ModelEventSourceAndSink<QueryModel> queryModelEvents = events.getEventSourceAndSink(QueryModel.class); ModelEventSourceAndSink<ResultsModel> resultsModelEvents = events.getEventSourceAndSink(ResultsModel.class); ModelEventSourceAndSink<FilteredResultsModel> filteredResultsModelEvents = events .getEventSourceAndSink(FilteredResultsModel.class); ModelEventSourceAndSink<StateEvent> stateEvents = events.getEventSourceAndSink(StateEvent.class); /**/*from ww w . j av a 2s. co m*/ * Model Layer */ QueryModel queryModel = new QueryModel(); queryModel.setEventSink(locationQueryModelEvents); queryModel.setQueryModelEventSink(queryModelEvents); TimedRegionModel timedRegionModel = new TimedRegionModel(); TimedPolygonModel timedPolygonModel = new TimedPolygonModel(); ResultsModel resultsModel = new ResultsModel(); resultsModel.setEvents(resultsModelEvents); FilteredResultsModel filteredResultsModel = new FilteredResultsModel(); filteredResultsModel.setResultsModel(resultsModel); filteredResultsModel.setEvents(filteredResultsModelEvents); PagedResultsModel pagedResultsModel = new PagedResultsModel(); pagedResultsModel.setModel(filteredResultsModel); pagedResultsModel.setEvents(stateEvents); TripPlanModel tripModel = new TripPlanModel(); /** * Control Layer */ YelpLocalSearchProvider localSearchProvider = new YelpLocalSearchProvider("VJYMvEAOfkqDeyHh4C9gTg"); localSearchProvider.setTimeout(10000); MapOverlayManager mapOverlayManager = new MapOverlayManager(); MinTransitTimeResultHandler minTransitTimeHandler = new MinTransitTimeResultHandler(); minTransitTimeHandler.setMapOverlayManager(mapOverlayManager); // minTransitTimeHandler.setTimedRegionModel(timedRegionModel); minTransitTimeHandler.setTimedPolygonModel(timedPolygonModel); OneBusAwayStandardControlImpl control = new OneBusAwayStandardControlImpl(); control.setStateEvents(stateEvents); // Models control.setQueryModel(queryModel); control.setResultsModel(resultsModel); control.setFilteredResultsModel(filteredResultsModel); control.setPagedResultsModel(pagedResultsModel); control.setTripPlanModel(tripModel); // Controls control.setLocalSearchProvider(localSearchProvider); control.setMinTransitTimeResultHandler(minTransitTimeHandler); control.setContextManager(manager); minTransitTimeHandler.setControl(control); /** * View Layer */ MapWidget mapWidget = new MapWidget(LatLng.newInstance(47.601533, -122.32933), 11); mapWidget.addControl(new LargeMapControl()); mapWidget.addControl(new MapTypeControl()); mapWidget.addControl(new ScaleControl()); ColorGradientControl colorGradient = new ColorGradientControl(); mapWidget.addControl(colorGradient); mapOverlayManager.setMapWidget(mapWidget); SearchWidget searchWidget = new SearchWidget(); searchWidget.setControl(control); searchWidget.setMapWidget(mapWidget); WelcomePagePresenter welcome = new WelcomePagePresenter(); AddressLookupPresenter addressLookup = new AddressLookupPresenter(); addressLookup.setControl(control); ResultsFilterPresenter filter = new ResultsFilterPresenter(); filter.setControl(control); ResultsTablePresenter resultsTable = new ResultsTablePresenter(); resultsTable.setControl(control); resultsTable.setResultsModel(pagedResultsModel); resultsTable.setMapOverlayManager(mapOverlayManager); resultsTable.setResultsFilterWidget(filter.getWidget()); CustomTimedOverlayManager timedOverlayManager = new CustomTimedOverlayManager(); timedOverlayManager.setMapOverlayManager(mapOverlayManager); timedOverlayManager.setQueryModel(queryModel); timedOverlayManager.setColorGradientControl(colorGradient); CustomTripPlanResultTablePresenter plansWidget = new CustomTripPlanResultTablePresenter(); plansWidget.setMapWidget(mapWidget); ActiveResultPresenter activeResult = new ActiveResultPresenter(); activeResult.setMapOverlayManager(mapOverlayManager); activeResult.setControl(control); MainPage mainPage = new MainPage(); mainPage.setControl(control); mainPage.setMapWidget(mapWidget); mainPage.setSearchWidget(searchWidget); mainPage.addResultsPanelWidget(welcome.getWidget()); mainPage.addResultsPanelWidget(addressLookup.getWidget()); mainPage.addResultsPanelWidget(resultsTable.getWidget()); mainPage.addResultsPanelWidget(activeResult.getWidget()); mainPage.addResultsPanelWidget(plansWidget.getWidget()); manager.addContextListener(mainPage); SearchOriginMapPresenter searchOriginMapMarker = new SearchOriginMapPresenter(); searchOriginMapMarker.setMapOverlayManager(mapOverlayManager); searchOriginMapMarker.setLocationQueryModel(queryModel); /** * Wire up all the listeners */ timedRegionModel.addModelListener(timedOverlayManager.getRegionModelListener()); timedPolygonModel.addModelListener(timedOverlayManager.getPolygonModelListener()); locationQueryModelEvents.addModelListener(control.getQueryModelHandler()); queryModelEvents.addModelListener(searchWidget.getQueryModelHandler()); resultsModelEvents.addModelListener(filteredResultsModel.getResultsModelHandler()); resultsModelEvents.addModelListener(filter.getResultsModelHandler()); filteredResultsModelEvents.addModelListener(pagedResultsModel.getModelListener()); tripModel.addModelListener(plansWidget); stateEvents.addModelListener(welcome.getStateEventListener()); stateEvents.addModelListener(resultsTable); stateEvents.addModelListener(activeResult); stateEvents.addModelListener(searchOriginMapMarker); stateEvents.addModelListener(plansWidget.getStateEventHandler()); stateEvents.addModelListener(timedOverlayManager.getStateEventHandler()); stateEvents.addModelListener(addressLookup.getStateEventListener()); StyleInjector.inject(OneBusAwayStandardResources.INSTANCE.getCss().getText()); StyleInjector.inject(TripPlannerResources.INSTANCE.getCss().getText()); StyleInjector.inject(CommonResources.INSTANCE.getApplicationCss().getText()); mainPage.initialize(); StandardApplicationContainer.add(mainPage); mainPage.onContextChanged(manager.getContext()); }
From source file:org.onebusaway.webapp.gwt.oba_application.view.MainPage.java
License:Apache License
public void initialize() { System.out.println("=================== creating results page..."); // initWidget(_uiBinder.createAndBindUi(this)); _dockLayoutPanel = new ResizableDockLayoutPanel(Unit.EM); _resultsPanel = new FlowPanel(); _mapPanel = makeMapPanel();/* w w w . ja v a2s .co m*/ _dockLayoutPanel.addNorth(_searchWidget, 4); _dockLayoutPanel.addWest(_resultsPanel, 18); _dockLayoutPanel.add(_mapPanel); initWidget(_dockLayoutPanel); _searchWidget.setDockLayoutPanelParent(_dockLayoutPanel); for (Widget widget : _resultPanelWidgets) _resultsPanel.add(widget); _map.addControl(new LargeMapControl()); _map.addControl(new MapTypeControl()); _map.addControl(new ScaleControl()); _map.setScrollWheelZoomEnabled(true); // We delay initialization of the map DeferredCommand.addCommand(new Command() { public void execute() { _map.checkResizeAndCenter(); } }); }
From source file:org.onebusaway.webapp.gwt.position_map.IndexPage.java
License:Apache License
public Widget create(final Context context) throws PageException { _map = new MapWidget(_center, _zoom); _map.addStyleName(_css.map());/*from w ww. java2 s . c o m*/ _map.addControl(new LargeMapControl()); _map.addControl(new MapTypeControl()); _map.addControl(new ScaleControl()); _map.setScrollWheelZoomEnabled(true); _map.addMapMoveEndHandler(new OurMapMoveHandler()); _overlayManager = new MapOverlayManager(_map); return _map; }