// Path: src/main/java/es/upm/fi/dia/oeg/map4rdf/share/Circle.java
// public interface Circle extends MapShape {
// 
// 	double getRadius();
// 
// 	TwoDimentionalCoordinate getCenter();
// }


import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.maps.client.InfoWindowContent;
import com.google.gwt.maps.client.MapPane;
import com.google.gwt.maps.client.MapPaneType;
import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.maps.client.event.MarkerClickHandler;
import com.google.gwt.maps.client.event.PolygonClickHandler;
import com.google.gwt.maps.client.event.PolylineClickHandler;
import com.google.gwt.maps.client.geom.LatLng;
import com.google.gwt.maps.client.geom.LatLngBounds;
import com.google.gwt.maps.client.overlay.Marker;
import com.google.gwt.maps.client.overlay.Overlay;
import com.google.gwt.maps.client.overlay.Polyline;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import es.upm.fi.dia.oeg.map4rdf.client.style.StyleMapShape;
import es.upm.fi.dia.oeg.map4rdf.share.Circle;
import es.upm.fi.dia.oeg.map4rdf.share.GoogleMapsAdapters;
import es.upm.fi.dia.oeg.map4rdf.share.Point;
import es.upm.fi.dia.oeg.map4rdf.share.PolyLine;
import es.upm.fi.dia.oeg.map4rdf.share.Polygon;
import es.upm.fi.dia.oeg.map4rdf.share.TwoDimentionalCoordinate;
	@Override
	public MapView getMapView() {
		return mapView;
	}

	@Override
	public HasClickHandlers draw(Point point) {
		Marker marker = new Marker(GoogleMapsAdapters.getLatLng(point));
		addOverlay(marker);
		return new MarkerClickHandlerWrapper(marker);
	}

	@Override
	public HasClickHandlers drawPolygon(StyleMapShape<Polygon> geometry) {
		com.google.gwt.maps.client.overlay.Polygon polygon = new com.google.gwt.maps.client.overlay.Polygon(
				GoogleMapsAdapters.getLatLngs((geometry.getMapShape()).getPoints()), geometry.getStrokeColor(),
				geometry.getStrokeWidth(), 1, geometry.getFillColor(), 1);
		addOverlay(polygon);
		return new PolygonClickHandlerWrapper(polygon);
	}

	@Override
	public HasClickHandlers drawPolyline(StyleMapShape<PolyLine> geometry) {
		Polyline line = new Polyline(GoogleMapsAdapters.getLatLngs((geometry.getMapShape()).getPoints()),
				geometry.getStrokeColor(), geometry.getStrokeWidth());
		addOverlay(line);
		return new PolylineClickHandlerWrapper(line);
	}

	@Override
// Path: src/main/java/es/upm/fi/dia/oeg/map4rdf/share/Circle.java
// public interface Circle extends MapShape {
// 
// 	double getRadius();
// 
// 	TwoDimentionalCoordinate getCenter();
// }


// Path: src/main/java/es/upm/fi/dia/oeg/map4rdf/client/view/v2/GoogleMapLayer.java
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.maps.client.InfoWindowContent;
import com.google.gwt.maps.client.MapPane;
import com.google.gwt.maps.client.MapPaneType;
import com.google.gwt.maps.client.MapWidget;
import com.google.gwt.maps.client.event.MarkerClickHandler;
import com.google.gwt.maps.client.event.PolygonClickHandler;
import com.google.gwt.maps.client.event.PolylineClickHandler;
import com.google.gwt.maps.client.geom.LatLng;
import com.google.gwt.maps.client.geom.LatLngBounds;
import com.google.gwt.maps.client.overlay.Marker;
import com.google.gwt.maps.client.overlay.Overlay;
import com.google.gwt.maps.client.overlay.Polyline;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import es.upm.fi.dia.oeg.map4rdf.client.style.StyleMapShape;
import es.upm.fi.dia.oeg.map4rdf.share.Circle;
import es.upm.fi.dia.oeg.map4rdf.share.GoogleMapsAdapters;
import es.upm.fi.dia.oeg.map4rdf.share.Point;
import es.upm.fi.dia.oeg.map4rdf.share.PolyLine;
import es.upm.fi.dia.oeg.map4rdf.share.Polygon;
import es.upm.fi.dia.oeg.map4rdf.share.TwoDimentionalCoordinate;

	@Override
	public MapView getMapView() {
		return mapView;
	}

	@Override
	public HasClickHandlers draw(Point point) {
		Marker marker = new Marker(GoogleMapsAdapters.getLatLng(point));
		addOverlay(marker);
		return new MarkerClickHandlerWrapper(marker);
	}

	@Override
	public HasClickHandlers drawPolygon(StyleMapShape<Polygon> geometry) {
		com.google.gwt.maps.client.overlay.Polygon polygon = new com.google.gwt.maps.client.overlay.Polygon(
				GoogleMapsAdapters.getLatLngs((geometry.getMapShape()).getPoints()), geometry.getStrokeColor(),
				geometry.getStrokeWidth(), 1, geometry.getFillColor(), 1);
		addOverlay(polygon);
		return new PolygonClickHandlerWrapper(polygon);
	}

	@Override
	public HasClickHandlers drawPolyline(StyleMapShape<PolyLine> geometry) {
		Polyline line = new Polyline(GoogleMapsAdapters.getLatLngs((geometry.getMapShape()).getPoints()),
				geometry.getStrokeColor(), geometry.getStrokeWidth());
		addOverlay(line);
		return new PolylineClickHandlerWrapper(line);
	}

	@Override
	public HasClickHandlers drawCircle(StyleMapShape<Circle> circle, String text) {