Example usage for com.google.gwt.maps.client.layers KmlLayer getMetadata

List of usage examples for com.google.gwt.maps.client.layers KmlLayer getMetadata

Introduction

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

Prototype

public final native KmlLayerMetadata getMetadata() ;

Source Link

Document

Get the metadata associated with this layer, as specified in the layer markup.

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 www .  j  a va  2s  . c om*/

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

}