/**
  * Restricts the Place search results to Places with a type matching at least one of the specified
  * types in this array. Valid types are given <a href=
  * "https://developers.google.com/maps/documentation/places/supported_types" >here</a>. TODO add
  * more AutocompleteType enums down the road. Otherwise use the setTypes(JsArrayString)
  *
  * @param types
  */
 public final void setTypes(AutocompleteType... types) {
   if (types == null) {
     return;
   }
   String[] stypes = new String[types.length];
   for (int i = 0; i < types.length; i++) {
     stypes[i] = types[i].value();
   }
   JsArrayString a = ArrayHelper.toJsArrayString(stypes);
   setTypesImpl(a);
 }
  private void findElevation(ClickMapEvent event) {

    LatLng[] a = new LatLng[1];
    a[0] = event.getMouseEvent().getLatLng();

    JsArray<LatLng> locations = ArrayHelper.toJsArray(a);

    LocationElevationRequest request = LocationElevationRequest.newInstance();
    request.setLocations(locations);

    ElevationService o = ElevationService.newInstance();
    o.getElevationForLocations(
        request,
        new ElevationServiceHandler() {
          public void onCallback(JsArray<ElevationResult> result, ElevationStatus status) {

            if (status == ElevationStatus.INVALID_REQUEST) {

            } else if (status == ElevationStatus.OK) {
              ElevationResult e = result.get(0);
              double elevation = e.getElevation();
              LatLng location = e.getLocation();
              double res = e.getResolution();

              GWT.log("worked elevation=" + elevation);
              drawInfoWindow(location, elevation);

            } else if (status == ElevationStatus.OVER_QUERY_LIMIT) {

            } else if (status == ElevationStatus.REQUEST_DENIED) {

            } else if (status == ElevationStatus.UNKNOWN_ERROR) {

            }

            GWT.log("elevation request finished");
          }
        });
  }
 /**
  * Triggers the given event. All arguments after eventName are passed as arguments to the
  * listeners. <br>
  * <b>Note:</b> Use Marker in objects to click on.
  *
  * @param w
  * @param eventType
  * @param objects
  */
 public static void trigger(MapWidget w, MapEventType eventType, JavaScriptObject... objects) {
   JsArray<JavaScriptObject> a = ArrayHelper.toJsArray(objects);
   triggerImpl(w, eventType.value(), a);
 }
 public final void setTypes(String... types) {
   setTypes(ArrayHelper.toJsArrayString(types));
 }