Example usage for com.google.gwt.maps.client NavigationControlStyle ANDROID

List of usage examples for com.google.gwt.maps.client NavigationControlStyle ANDROID

Introduction

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

Prototype

NavigationControlStyle ANDROID

To view the source code for com.google.gwt.maps.client NavigationControlStyle ANDROID.

Click Source Link

Document

The small zoom control similar to the one used by the native Maps application on Android.

Usage

From source file:com.google.mobile.trippy.web.client.view.MapView.java

License:Apache License

private MapWidget createMapWidget(final HasLatLng center, final int zoom) {

    String mapTypeId = new MapTypeId().getRoadmap();

    HasNavigationControlOptions navOptions = new NavigationControlOptions(new ControlPositionImpl(),
            new NavigationControlStyleImpl());
    navOptions.setPosition(ControlPosition.BOTTOM);
    navOptions.setStyle(NavigationControlStyle.ANDROID);

    HasScaleControlOptions scaleOptions = new ScaleControlOptions(new ControlPositionImpl(),
            new ScaleControlStyleImpl());
    scaleOptions.setStyle(ScaleControlStyle.DEFAULT);

    HasMapTypeControlOptions mapTypeOptions = new MapTypeControlOptions(new ControlPositionImpl(),
            new MapTypeControlStyleImpl());
    mapTypeOptions.setStyle(MapTypeControlStyle.DROPDOWN_MENU);

    HasMapOptions options = new MapOptions();
    options.setCenter(center);//from  ww w  .j a  va 2s .com
    options.setZoom(zoom);
    options.setMapTypeId(mapTypeId);
    options.setBackgroundColor("white");
    options.setNavigationControl(true);
    //    options.setNavigationControlOptions(navOptions);
    options.setScaleControl(false);
    //    options.setScaleControlOptions(scaleOptions);
    options.setMapTypeControl(true);
    options.setMapTypeControlOptions(mapTypeOptions);
    options.setDraggable(true);
    return new MapWidget(options);

}