Example usage for com.google.gwt.maps.client AdsManager newInstance

List of usage examples for com.google.gwt.maps.client AdsManager newInstance

Introduction

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

Prototype

public static native AdsManager newInstance(MapWidget map, String publisherId, AdsManagerOptions options) ;

Source Link

Document

Create a new AdsManager instance.

Usage

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

License:Apache License

public AdsManagerDemo() {
    MapOptions mapOptions = MapOptions.newInstance();
    mapOptions.setSize(Size.newInstance(500, 600));

    // Mountain View
    LatLng city = LatLng.newInstance(37.4419, -122.1419);
    map = new MapWidget(city, 13, mapOptions);
    map.setUIToDefault();//w  ww  . j ava 2  s.co m

    AdsManagerOptions adsOptions = AdsManagerOptions.newInstance();
    adsOptions.setMaxAdsOnMap(3);
    adsOptions.setStyle(AdsManagerOptions.STYLE_ADUNIT);
    String publisherId = "pub-1234567890123456"; // bogus publisher id
    AdsManager adsManager = AdsManager.newInstance(map, publisherId, adsOptions);
    adsManager.setEnabled(true);

    initWidget(map);
}