Example usage for com.google.gwt.maps.client.events.kmlmouse KmlMouseMapEvent getLatLng

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

Introduction

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

Prototype

public LatLng getLatLng() 

Source Link

Document

get The position at which to anchor an infowindow on the clicked feature.

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  ww w . ja v  a  2 s  .  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);

}