List of usage examples for com.google.gwt.maps.client MapType getNormalMap
public static MapType getNormalMap()
From source file:com.google.gwt.maps.sample.hellomaps.client.CustomControlDemo.java
License:Apache License
/** * Provide access to the HierarchicalMapTypeControl singleton. * //from w ww . j ava 2 s . co m * @return an instance of the control is created if necessary. */ private static HierarchicalMapTypeControl getHierarchicalMapTypeControl() { if (hControl != null) { return hControl; } hControl = new HierarchicalMapTypeControl(); hControl.addRelationship(MapType.getNormalMap(), MapType.getMarsVisibleMap(), "Mars visible"); hControl.addRelationship(MapType.getNormalMap(), MapType.getMarsInfraredMap(), "Mars infrared"); hControl.addRelationship(MapType.getNormalMap(), MapType.getMarsElevationMap(), "Mars elevation", true); return hControl; }
From source file:com.google.gwt.maps.sample.hellomaps.client.CustomControlDemo.java
License:Apache License
public CustomControlDemo() { VerticalPanel vertPanel = new VerticalPanel(); vertPanel.setStyleName("hm-panel"); actionListBox = new ListBox(); for (ControlDemos cd : ControlDemos.values()) { actionListBox.addItem(cd.valueOf()); }//from w ww. j av a2s.c o m actionListBox.addChangeListener(new ChangeListener() { public void onChange(Widget sender) { displayCustomControl(); } }); HorizontalPanel horizPanel = new HorizontalPanel(); horizPanel.add(new Label("Choose Action:")); horizPanel.add(actionListBox); horizPanel.setSpacing(10); vertPanel.add(horizPanel); map = new MapWidget(LatLng.newInstance(37.441944, -122.141944), 13); map.setSize("500px", "300px"); map.addMapType(MapType.getNormalMap()); map.addMapType(MapType.getSatelliteMap()); map.addMapType(MapType.getMarsVisibleMap()); map.addMapType(MapType.getMarsElevationMap()); map.addMapType(MapType.getMarsInfraredMap()); vertPanel.add(map); new Timer() { public void run() { displayCustomControl(); } }.schedule(250); initWidget(vertPanel); }
From source file:org.sigmah.client.map.MapTypeFactory.java
License:Open Source License
/** * Creates the default MapType for "localisation", that is selecting * the geographic position of sites./*from w w w . ja v a2 s . c o m*/ * * @param country The country for which to return the MapType * @return a GoogleMaps MapType */ public static MapType createLocalisationMapType(CountryDTO country) { // TODO: generalize // There are probably other cases where we need to add custom tiles // for poorly covered countries if (country.getName().equals("RDC")) { TileLayer[] layers = new TileLayer[1]; layers[0] = new RgcTileLayer("http://www.pear.cd/ActivityInfo/tiles/admin", 6, 10); Projection projection = new MercatorProjection(11); return new MapType(layers, projection, "Admin"); } else { return MapType.getNormalMap(); } }
From source file:org.sigmah.client.page.map.MapPreview.java
License:Open Source License
private void changeBaseMapIfNeeded(BaseMap baseMap) { if (currentBaseMapId == null || !currentBaseMapId.equals(baseMap.getId())) { MapType baseMapType = MapTypeFactory.mapTypeForBaseMap(baseMap); map.addMapType(baseMapType);/* ww w . ja v a 2 s. co m*/ map.setCurrentMapType(baseMapType); map.removeMapType(MapType.getNormalMap()); map.removeMapType(MapType.getHybridMap()); currentBaseMapId = baseMap.getId(); } }
From source file:org.thechiselgroup.choosel.visualization_component.map.client.Map.java
License:Apache License
public String getMapType() { MapType mapType = map.getCurrentMapType(); if (MapType.getNormalMap().equals(mapType)) { return MAP_TYPE_NORMAL; } else if (MapType.getSatelliteMap().equals(mapType)) { return MAP_TYPE_SATELLITE; } else if (MapType.getPhysicalMap().equals(mapType)) { return MAP_TYPE_PHYSICAL; } else if (MapType.getHybridMap().equals(mapType)) { return MAP_TYPE_HYBRID; } else {// w ww .ja va 2 s . co m throw new RuntimeException("map type persistence not supported for type " + mapType.getName(false)); } }
From source file:org.thechiselgroup.choosel.visualization_component.map.client.Map.java
License:Apache License
public void setMapType(String mapTypeID) { if (MAP_TYPE_NORMAL.equals(mapTypeID)) { map.setCurrentMapType(MapType.getNormalMap()); } else if (MAP_TYPE_SATELLITE.equals(mapTypeID)) { map.setCurrentMapType(MapType.getSatelliteMap()); } else if (MAP_TYPE_PHYSICAL.equals(mapTypeID)) { map.setCurrentMapType(MapType.getPhysicalMap()); } else if (MAP_TYPE_HYBRID.equals(mapTypeID)) { map.setCurrentMapType(MapType.getHybridMap()); } else {//from w w w. j ava 2 s .c om throw new RuntimeException("map type persistence not supported for type " + mapTypeID); } }