Example usage for com.google.gwt.maps.client.events.kmlmouse KmlMouseMapHandler KmlMouseMapHandler

List of usage examples for com.google.gwt.maps.client.events.kmlmouse KmlMouseMapHandler KmlMouseMapHandler

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.events.kmlmouse KmlMouseMapHandler KmlMouseMapHandler.

Prototype

KmlMouseMapHandler

Source Link

Usage

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

License:Apache License

private void drawKml2() {

    // String url =
    // "http://api.flickr.com/services/feeds/geo/?g=322338@N20&lang=en-us&format=feed-georss";

    // TODO this won't work in devmode but works in production, can't point to
    // localhost.
    String base = GWT.getHostPageBaseURL();
    String url = base + "/kmlgenerator?id=120234&pass=1345&msg=hi";

    KmlLayer o = KmlLayer.newInstance(url);
    o.setMap(mapWidget);/*from  w  w w  . ja v  a2s  .c o m*/

    o.addClickHandler(new KmlMouseMapHandler() {
        public void onEvent(KmlMouseMapEvent event) {
            KmlFeatureData featureData = event.getFeatureData();

            @SuppressWarnings("unused")
            LatLng latlng = event.getLatLng();

            @SuppressWarnings("unused")
            Size size = event.getPixelOffset();
            GWT.log("clicked featureData=" + featureData.getToString());
        }
    });

    // TODO I need a better link with more meta data
    @SuppressWarnings("unused")
    KmlLayerMetadata metaData = o.getMetadata();
    // KmlAuthor author = metaData.getAuthor();
    // String authName = author.getName();
    // String authEmail = author.getEmail();
    // String authUri = author.getUri();
    //
    // String desc = metaData.getDescription();
    // String name = metaData.getName();
    // String snippet = metaData.getSnippet();

    // GWT.log("work? authName=" + authName);

}