Ejemplo n.º 1
0
 /**
  * Get the polyline through a given geocode address
  *
  * @param placemark {@link Placemark} = the geocode address
  * @return {@link Polyline}
  */
 public Polyline getPolyline(Placemark placemark) {
   LatLng ne =
       LatLng.newInstance(
           placemark.getExtendedData().getBounds().getNorthEast().getLatitude(),
           placemark.getExtendedData().getBounds().getNorthEast().getLongitude());
   LatLng se =
       LatLng.newInstance(
           placemark.getExtendedData().getBounds().getSouthWest().getLatitude(),
           placemark.getExtendedData().getBounds().getNorthEast().getLongitude());
   LatLng sw =
       LatLng.newInstance(
           placemark.getExtendedData().getBounds().getSouthWest().getLatitude(),
           placemark.getExtendedData().getBounds().getSouthWest().getLongitude());
   LatLng nw =
       LatLng.newInstance(
           placemark.getExtendedData().getBounds().getNorthEast().getLatitude(),
           placemark.getExtendedData().getBounds().getSouthWest().getLongitude());
   LatLng[] latLngs = new LatLng[4];
   latLngs[0] = ne;
   latLngs[1] = se;
   latLngs[2] = sw;
   latLngs[3] = nw;
   Polyline polyline = new Polyline(latLngs, "#ff0000", 2, 1.0);
   return polyline;
 }
 private void handleSearchAddressResult(Placemark mark) {
   mDisplay.getMapWidget().setCenter(mark.getPoint());
   mDisplay.getMapWidget().setZoomLevel(15);
   final Marker m = new Marker(mark.getPoint());
   m.addMarkerClickHandler(
       new MarkerClickHandler() {
         @Override
         public void onClick(MarkerClickEvent event) {
           mDisplay.getMapWidget().removeOverlay(m);
         }
       });
   mDisplay.getMapWidget().addOverlay(m);
 }
 @Override
 public String toString() {
   return "Place(name="
       + getName()
       + " description="
       + getDescriptionAsString()
       + " accuracy="
       + _placemark.getAccuracy()
       + ")";
 }
 public int getAccuracy() {
   return _placemark.getAccuracy();
 }
 public LatLng getLocation() {
   return _placemark.getPoint();
 }
 public List<String> getDescription() {
   List<String> desc = new ArrayList<String>();
   desc.add(
       _placemark.getCity() + ", " + _placemark.getState() + " " + _placemark.getPostalCode());
   return desc;
 }
 public String getName() {
   return _placemark.getStreet();
 }