Example usage for com.google.gwt.maps.client MapType getName

List of usage examples for com.google.gwt.maps.client MapType getName

Introduction

In this page you can find the example usage for com.google.gwt.maps.client MapType getName.

Prototype

public String getName(boolean shortName) 

Source Link

Document

Returns the translated, human-readable string name of the map type.

Usage

From source file:com.google.gwt.maps.sample.hellomaps.client.ControlsDemo.java

License:Apache License

public ControlsDemo() {
    map = new MapWidget(LatLng.newInstance(37.4419, -122.1419), 13);
    map.setSize("500px", "300px");
    initWidget(map);/*from   w  ww .  j a  v a 2  s.c  o m*/
    map.addControl(new SmallMapControl());
    map.addControl(new MapTypeControl());

    Timer timer = new Timer() {

        @Override
        public void run() {
            // Exercise the minimum & maximum resolution entry points.
            MapType types[] = map.getMapTypes();
            for (MapType t : types) {
                int minResolution = t.getMinimumResolution();
                int maxResolution = t.getMaximumResolution();
                GWT.log("Map Type: " + t.getName(true) + " Min resolution: " + minResolution
                        + " Max Resolution: " + maxResolution, null);

                minResolution = t.getMinimumResolution();
                maxResolution = t.getMaximumResolution();
                GWT.log("@ point: " + map.getCenter().toString() + " Map Type: " + t.getName(true)
                        + " Min resolution: " + minResolution + " Max Resolution: " + maxResolution, null);
            }
        }
    };
    timer.schedule(1000);
}

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 {//from w  ww .  j  a v  a2s  .co  m
        throw new RuntimeException("map type persistence not supported for type " + mapType.getName(false));
    }
}