コード例 #1
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();
  }
コード例 #2
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();
  }