|
1 | 1 | package com.google.maps; |
2 | 2 |
|
3 | 3 | import com.google.maps.internal.ApiConfig; |
| 4 | +import com.google.maps.internal.StringJoin.UrlValue; |
4 | 5 | import com.google.maps.model.LatLng; |
5 | 6 | import com.google.maps.model.Size; |
6 | 7 | import java.awt.image.BufferedImage; |
@@ -55,10 +56,64 @@ public StaticMapsRequest center(String location) { |
55 | 56 | * @return Returns this {@code StaticMapsRequest} for call chaining. |
56 | 57 | */ |
57 | 58 | public StaticMapsRequest zoom(int zoom) { |
58 | | - return param("zoom", Integer.toString(zoom)); |
| 59 | + return param("zoom", zoom); |
59 | 60 | } |
60 | 61 |
|
| 62 | + /** |
| 63 | + * <code>size</code> defines the rectangular dimensions of the map image. |
| 64 | + * |
| 65 | + * @param size The Size of the static map. |
| 66 | + * @return Returns this {@code StaticMapsRequest} for call chaining. |
| 67 | + */ |
61 | 68 | public StaticMapsRequest size(Size size) { |
62 | 69 | return param("size", size); |
63 | 70 | } |
| 71 | + |
| 72 | + /** |
| 73 | + * <code>scale</code> affects the number of pixels that are returned. Setting <code>scale</code> to 2 returns twice as many pixels as <code>scale</code> set to 1 while retaining the same coverage area and level of detail (i.e. the contents of the map doesn't change). |
| 74 | + * |
| 75 | + * @param scale The scale of the static map. |
| 76 | + * @return Returns this {@code StaticMapsRequest} for call chaining. |
| 77 | + */ |
| 78 | + public StaticMapsRequest scale(int scale) { |
| 79 | + return param("scale", scale); |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * <code>format</code> defines the format of the resulting image. By default, the Google Static Maps API creates PNG images. There are several possible formats including GIF, JPEG and PNG types. |
| 84 | + * |
| 85 | + * @param format The format of the static map. |
| 86 | + * @return Returns this {@code StaticMapsRequest} for call chaining. |
| 87 | + */ |
| 88 | + public StaticMapsRequest format(String format) { |
| 89 | + return param("format", format); |
| 90 | + } |
| 91 | + |
| 92 | + public enum StaticMapType implements UrlValue { |
| 93 | + roadmap, satellite, terrain, hybrid; |
| 94 | + |
| 95 | + public String toUrlValue() { |
| 96 | + return this.name(); |
| 97 | + } |
| 98 | + } |
| 99 | + |
| 100 | + /** |
| 101 | + * <code>maptype</code> defines the type of map to construct. |
| 102 | + * |
| 103 | + * @param maptype The map type of the static map. |
| 104 | + * @return Returns this {@code StaticMapsRequest} for call chaining. |
| 105 | + */ |
| 106 | + public StaticMapsRequest maptype(StaticMapType maptype) { |
| 107 | + return param("maptype", maptype); |
| 108 | + } |
| 109 | + |
| 110 | + /** |
| 111 | + * <code>region</code> defines the appropriate borders to display, based on geo-political sensitivities. Accepts a region code specified as a two-character ccTLD ('top-level domain') value. |
| 112 | + * |
| 113 | + * @param region The region of the static map. |
| 114 | + * @return Returns this {@code StaticMapsRequest} for call chaining. |
| 115 | + */ |
| 116 | + public StaticMapsRequest region(String region) { |
| 117 | + return param("region", region); |
| 118 | + } |
64 | 119 | } |
0 commit comments