package com.cedicam.gpda.ihm.client;

import com.google.gwt.dom.client.Node;
import com.google.maps.gwt.client.GoogleMap;
import com.google.maps.gwt.client.MapOptions;

public class MyGoogleMap extends GoogleMap {

	public static native MyGoogleMap create(Node mapDiv)/*-{
		return new $wnd.google.maps.Map(mapDiv);
	}-*/;

	/**
	 * Creates a new map inside of the given HTML container, which is typically
	 * a <code>DIV</code>
	 * 
	 * element.
	 */
	public static native MyGoogleMap create(Node mapDiv, MapOptions opts)/*-{
		var _opts;
		if (@com.google.gwt.core.client.GWT::isScript()()) {
			_opts = opts;
		} else {
			_opts = {};
			for (k in opts) {
				if (k != "__gwt_ObjectId") {
					_opts[k] = opts[k];
				}
			}
		}
		return new $wnd.google.maps.Map(mapDiv, _opts);
	}-*/;

	/**
	 * Removes all listeners for all events for the given instance.
	 */
	public final native void clearOverlays()/*-{
		$wnd.google.maps.event.clearOverlays(this);
	}-*/;
}
