Example usage for com.google.gwt.maps.client.layers KmlFeatureData getToString

List of usage examples for com.google.gwt.maps.client.layers KmlFeatureData getToString

Introduction

In this page you can find the example usage for com.google.gwt.maps.client.layers KmlFeatureData getToString.

Prototype

public final native String getToString() ;

Source Link

Document

get to this object json string

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);// w w w.  jav a 2 s.  com

    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);

}