Follow us on GitHub

com.google.gwt.maps.client.adsense
Class AdUnitImpl

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.maps.client.mvc.MVCObject<AdUnitImpl>
          extended by com.google.gwt.maps.client.adsense.AdUnitImpl

public class AdUnitImpl
extends MVCObject<AdUnitImpl>

Implements AdSense for Content advertising on an associated map. To use an AdUnit, you must obtain and specify an AdSense for Content publisher ID within the AdUnit's constructor options. This class extends MVCObject.

See AdUnit API Doc


Constructor Summary
protected AdUnitImpl()
          use newInstance();
 
Method Summary
 HandlerRegistration addChannelNumberChangeHandler(ChannelNumberChangeMapHandler handler)
          This event is fired when the AdUnit's channelNumber property changes.
 HandlerRegistration addFormatChangeHandler(FormatChangeMapHandler handler)
          This event is fired when the AdUnit's format property changes.
 HandlerRegistration addMapChangeHandler(MapChangeMapHandler handler)
          This event is fired when the AdUnit's map property changes.
 HandlerRegistration addPositionChangeHandler(PositionChangeMapHandler handler)
          This event is fired when the AdUnit's position property changes.
 String getChannelNumber()
          Returns the channel number in use by this AdUnit.
 Element getContainer()
          Returns the containing element of the AdUnit.
 AdFormat getFormat()
          Returns the format in use by this AdUnit.
 MapWidget getMap()
          Returns the map to which this AdUnit's ads are targeted.
 ControlPosition getPosition()
          Returns the ControlPosition at which this AdUnit is displayed on the map.
 String getPublisherId()
          Returns the specified AdSense For Content publisher ID.
static AdUnitImpl newInstance(Element container, AdUnitOptions options)
          Creates an AdSense for Content display ad on the associated map.
 void setChannelNumber(String channelNumber)
          Specifies the channel number for this AdUnit.
 void setFormat(AdFormat format)
          Specifies the display format for this AdUnit.
 void setMap(MapWidget mapWidget)
          Associates this AdUnit with the specified map.
 void setPosition(ControlPosition position)
          Sets the ControlPosition at which to display the AdUnit on the map.
 
Methods inherited from class com.google.gwt.maps.client.mvc.MVCObject
bindTo, bindTo, bindTo, changed, createInstanceOfMVCObject, get, notify, set, setValues, unbind, unbindAll
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdUnitImpl

protected AdUnitImpl()
use newInstance();

Method Detail

newInstance

public static final AdUnitImpl newInstance(Element container,
                                           AdUnitOptions options)
Creates an AdSense for Content display ad on the associated map.

Parameters:
options -

addChannelNumberChangeHandler

public final HandlerRegistration addChannelNumberChangeHandler(ChannelNumberChangeMapHandler handler)
This event is fired when the AdUnit's channelNumber property changes.

Parameters:
handler -

addFormatChangeHandler

public final HandlerRegistration addFormatChangeHandler(FormatChangeMapHandler handler)
This event is fired when the AdUnit's format property changes.

Parameters:
handler -

addMapChangeHandler

public final HandlerRegistration addMapChangeHandler(MapChangeMapHandler handler)
This event is fired when the AdUnit's map property changes.

Parameters:
handler -

addPositionChangeHandler

public final HandlerRegistration addPositionChangeHandler(PositionChangeMapHandler handler)
This event is fired when the AdUnit's position property changes.

Parameters:
handler -

getChannelNumber

public final String getChannelNumber()
Returns the channel number in use by this AdUnit.


getContainer

public final Element getContainer()
Returns the containing element of the AdUnit.


getFormat

public final AdFormat getFormat()
Returns the format in use by this AdUnit.


getMap

public final MapWidget getMap()
Returns the map to which this AdUnit's ads are targeted.


getPosition

public final ControlPosition getPosition()
Returns the ControlPosition at which this AdUnit is displayed on the map.


getPublisherId

public final String getPublisherId()
Returns the specified AdSense For Content publisher ID.


setChannelNumber

public final void setChannelNumber(String channelNumber)
Specifies the channel number for this AdUnit. Channel numbers are optional and can be created for Google AdSense tracking.

Parameters:
channelNumber -

setFormat

public final void setFormat(AdFormat format)
Specifies the display format for this AdUnit.

Parameters:
format -

setMap

public final void setMap(MapWidget mapWidget)
Associates this AdUnit with the specified map. Ads will be targeted to the map's viewport. The map must be specified in order to display ads.

Parameters:
mapWidget -

setPosition

public final void setPosition(ControlPosition position)
Sets the ControlPosition at which to display the AdUnit on the map. If the position is set to null, the AdUnit is removed from the map.

Parameters:
position - ControlPosition


Follow us on GitHub

Copyright © 2011-2012 Gone Vertical LLC. All Rights Reserved.