Example usage for com.google.gwt.maps.client.events.click ClickMapEvent getMouseEvent

List of usage examples for com.google.gwt.maps.client.events.click ClickMapEvent getMouseEvent

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.events.click ClickMapEvent getMouseEvent.

Prototype

public MouseEvent getMouseEvent() 

Source Link

Usage

From source file:com.google.gwt.maps.testing.client.maps.AdvancedLayersWidget.java

License:Apache License

private void drawMap() {
    LatLng center = LatLng.newInstance(42.35, -71.07);
    MapOptions opts = MapOptions.newInstance();
    opts.setZoom(14);/* w w  w  . j  a  va 2 s  . com*/
    opts.setCenter(center);
    opts.setMapTypeId(MapTypeId.ROADMAP);

    mapWidget = new MapWidget(opts);
    pWidget.add(mapWidget);
    mapWidget.setSize("750px", "500px");

    mapWidget.addClickHandler(new ClickMapHandler() {
        public void onEvent(ClickMapEvent event) {
            // TODO fix the event getting, getting ....
            GWT.log("clicked on latlng=" + event.getMouseEvent().getLatLng());
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.AutocompletePlacesMapWidget.java

License:Apache License

private void drawMap() {
    LatLng center = LatLng.newInstance(49.496675, -102.65625);
    MapOptions opts = MapOptions.newInstance();
    opts.setZoom(8);/* www. j  a  v  a 2 s.com*/
    opts.setCenter(center);
    opts.setMapTypeId(MapTypeId.TERRAIN);

    mapWidget = new MapWidget(opts);
    pWidget.add(mapWidget);
    mapWidget.setSize("750px", "500px");

    mapWidget.addClickHandler(new ClickMapHandler() {
        public void onEvent(ClickMapEvent event) {
            // TODO fix the event getting, getting ....
            GWT.log("clicked on latlng=" + event.getMouseEvent().getLatLng());
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.BasicMapWidget.java

License:Apache License

private void drawBasicMarker() {
    LatLng center = LatLng.newInstance(47.8, -121.4);
    MarkerOptions options = MarkerOptions.newInstance();
    options.setPosition(center);/* w  w  w. ja  v a 2 s  . c o  m*/
    options.setTitle("Hello World");

    markerBasic = Marker.newInstance(options);
    markerBasic.setMap(mapWidget);

    markerBasic.addClickHandler(new ClickMapHandler() {
        @Override
        public void onEvent(ClickMapEvent event) {
            drawInfoWindow(markerBasic, event.getMouseEvent());
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.BasicMapWidget.java

License:Apache License

private void drawMap() {
    LatLng center = LatLng.newInstance(49.496675, -102.65625);
    MapOptions opts = MapOptions.newInstance();
    opts.setZoom(4);/*www .  ja  va2 s .  co  m*/
    opts.setCenter(center);
    opts.setMapTypeId(MapTypeId.HYBRID);

    mapWidget = new MapWidget(opts);
    pWidget.add(mapWidget);
    mapWidget.setSize("750px", "500px");

    mapWidget.addClickHandler(new ClickMapHandler() {
        @Override
        public void onEvent(ClickMapEvent event) {
            // TODO fix the event getting, getting ....
            GWT.log("clicked on latlng=" + event.getMouseEvent().getLatLng());
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.ControlsMapWidget.java

License:Apache License

private void drawMap() {

    MapTypeControlOptions controlOptions = MapTypeControlOptions.newInstance();
    controlOptions.setMapTypeIds(MapTypeId.values()); // use all of them
    controlOptions.setPosition(ControlPosition.RIGHT_CENTER);

    LatLng center = LatLng.newInstance(49.496675, -102.65625);
    MapOptions options = MapOptions.newInstance();
    options.setZoom(4);/*from   w w  w  .ja  v a  2 s . c  om*/
    options.setCenter(center);
    options.setMapTypeId(MapTypeId.HYBRID);
    options.setMapTypeControlOptions(controlOptions);

    mapWidget = new MapWidget(options);
    pWidget.add(mapWidget);
    mapWidget.setSize("750px", "500px");

    mapWidget.addClickHandler(new ClickMapHandler() {
        public void onEvent(ClickMapEvent event) {
            // TODO fix the event getting, getting ....
            GWT.log("clicked on latlng=" + event.getMouseEvent().getLatLng());
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.DrawingMapWidget.java

License:Apache License

private void drawMap() {
    LatLng center = LatLng.newInstance(49.496675, -102.65625);
    MapOptions opts = MapOptions.newInstance();
    opts.setZoom(4);/*from   w ww  .j a v a2  s .co m*/
    opts.setCenter(center);
    opts.setMapTypeId(MapTypeId.HYBRID);

    mapWidget = new MapWidget(opts);
    pWidget.add(mapWidget);
    mapWidget.setSize("750px", "500px");

    mapWidget.addClickHandler(new ClickMapHandler() {
        @Override
        public void onEvent(ClickMapEvent event) {
            GWT.log("clicked on latlng=" + event.getMouseEvent().getLatLng());
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.ElevationMapWidget.java

License:Apache License

private void drawMap() {
    LatLng center = LatLng.newInstance(39.31, -106.02);
    MapOptions opts = MapOptions.newInstance();
    opts.setZoom(8);//from  www. ja  v  a2  s  . co  m
    opts.setCenter(center);
    opts.setMapTypeId(MapTypeId.TERRAIN);

    mapWidget = new MapWidget(opts);
    pWidget.add(mapWidget);
    mapWidget.setSize("750px", "500px");

    mapWidget.addClickHandler(new ClickMapHandler() {
        @Override
        public void onEvent(ClickMapEvent event) {
            GWT.log("clicked on latlng=" + event.getMouseEvent().getLatLng());

            LatLng point = event.getMouseEvent().getLatLng();
            findElevation(point);
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.FullPageMapWidget.java

License:Apache License

private void drawMap() {
    LatLng center = LatLng.newInstance(49.496675, -102.65625);
    MapOptions opts = MapOptions.newInstance();
    opts.setZoom(4);//from w  ww.  j  av a2 s . co  m
    opts.setCenter(center);
    opts.setMapTypeId(MapTypeId.HYBRID);

    mapWidget = new MapWidget(opts);
    pWidget.add(mapWidget);
    mapWidget.setSize("100%", "100%");

    mapWidget.addClickHandler(new ClickMapHandler() {
        public void onEvent(ClickMapEvent event) {
            // TODO fix the event getting, getting ....
            GWT.log("clicked on latlng=" + event.getMouseEvent().getLatLng());
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.InfoWindowMapWidget.java

License:Apache License

private void drawMarker1() {
    LatLng center = LatLng.newInstance(47.8, -121.4);
    MarkerOptions options = MarkerOptions.newInstance();
    options.setPosition(center);/*from   ww  w.jav  a  2  s .  c om*/
    options.setTitle("Hello World");

    final Marker marker = Marker.newInstance(options);
    marker.setMap(mapWidget);

    marker.addClickHandler(new ClickMapHandler() {
        public void onEvent(ClickMapEvent event) {
            drawInfoWindow(marker, event.getMouseEvent());
        }
    });
}

From source file:com.google.gwt.maps.testing.client.maps.InfoWindowMapWidget.java

License:Apache License

private void drawMap() {
    LatLng center = LatLng.newInstance(49.496675, -102.65625);
    MapOptions opts = MapOptions.newInstance();
    opts.setZoom(4);/*from   w  w w .java2 s .  c om*/
    opts.setCenter(center);
    opts.setMapTypeId(MapTypeId.HYBRID);

    mapWidget = new MapWidget(opts);
    pWidget.add(mapWidget);
    mapWidget.setSize("750px", "500px");

    mapWidget.addClickHandler(new ClickMapHandler() {
        public void onEvent(ClickMapEvent event) {
            GWT.log("clicked on latlng=" + event.getMouseEvent().getLatLng());
        }
    });

    mapWidget.addTilesLoadedHandler(new TilesLoadedMapHandler() {
        public void onEvent(TilesLoadedMapEvent event) {
            // Load something after the tiles load
        }
    });
}