コード例 #1
0
    public static String toString(MapMarker... markers) {
      if (markers.length > 0) {
        StringBuilder sb = new StringBuilder();

        sb.append(MarkersKey).append("=");

        for (int i = 0; i < markers.length; i++) {
          sb.append(markers[i].toString());
          if (i != markers.length - 1) sb.append(MarkerSeparator);
        }

        return sb.toString();
      } else {
        return "";
      }
    }
コード例 #2
0
  // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  // param handling and uri generation
  // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  public String getURI(double lat, double lon, int sizeW, int sizeH, MapMarker... markers) {
    _validateParams(sizeW, sizeH, ZoomDefault);

    // generate the URI
    StringBuilder sb = new StringBuilder();
    sb.append(GmapStaticURI);

    // size key
    sb.append("?").append(SizeKey).append("=").append(sizeW).append(SizeSeparator).append(sizeH);

    // markers key
    sb.append("&").append(MarkerUtils.toString(markers));

    // maps key
    sb.append("&").append(GmapLicenseKey).append("=").append(GmapLicense);

    return sb.toString();
  }
コード例 #3
0
  public String getURI(double lat, double lon, int sizeW, int sizeH, int zoom) {
    _validateParams(sizeW, sizeH, zoom);

    // generate the URI
    StringBuilder sb = new StringBuilder();
    sb.append(GmapStaticURI);

    // center key
    sb.append("?").append(CenterKey).append("=").append(lat).append(",").append(lon);

    // zoom key
    sb.append("&").append(ZoomKey).append("=").append(zoom);

    // size key
    sb.append("&").append(SizeKey).append("=").append(sizeW).append(SizeSeparator).append(sizeH);

    // markers key
    sb.append("&").append(MarkerUtils.toString(new MapMarker(lat, lon)));

    // maps key
    sb.append("&").append(GmapLicenseKey).append("=").append(GmapLicense);

    return sb.toString();
  }