Line | |
---|
1 | package iodb;
|
---|
2 |
|
---|
3 | import java.util.Map;
|
---|
4 | import org.openstreetmap.josm.data.coor.CoordinateFormat;
|
---|
5 | import org.openstreetmap.josm.data.coor.LatLon;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * An offset.
|
---|
9 | *
|
---|
10 | * @author zverik
|
---|
11 | */
|
---|
12 | public class ImageryOffset extends ImageryOffsetBase {
|
---|
13 | private LatLon imageryPos;
|
---|
14 | private String imagery;
|
---|
15 | private int minZoom, maxZoom;
|
---|
16 |
|
---|
17 | public ImageryOffset( String imagery, LatLon imageryPos ) {
|
---|
18 | this.imageryPos = imageryPos;
|
---|
19 | this.imagery = imagery;
|
---|
20 | this.minZoom = 0;
|
---|
21 | this.maxZoom = 30;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public void setMaxZoom(int maxZoom) {
|
---|
25 | this.maxZoom = maxZoom;
|
---|
26 | }
|
---|
27 |
|
---|
28 | public void setMinZoom(int minZoom) {
|
---|
29 | this.minZoom = minZoom;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public LatLon getImageryPos() {
|
---|
33 | return imageryPos;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public String getImagery() {
|
---|
37 | return imagery;
|
---|
38 | }
|
---|
39 |
|
---|
40 | public int getMaxZoom() {
|
---|
41 | return maxZoom;
|
---|
42 | }
|
---|
43 |
|
---|
44 | public int getMinZoom() {
|
---|
45 | return minZoom;
|
---|
46 | }
|
---|
47 |
|
---|
48 | @Override
|
---|
49 | public void putServerParams( Map<String, String> map ) {
|
---|
50 | super.putServerParams(map);
|
---|
51 | map.put("imagery", imagery);
|
---|
52 | map.put("imlat", imageryPos.latToString(CoordinateFormat.DECIMAL_DEGREES));
|
---|
53 | map.put("imlon", imageryPos.lonToString(CoordinateFormat.DECIMAL_DEGREES));
|
---|
54 | if( minZoom > 0 )
|
---|
55 | map.put("minzoom", String.valueOf(minZoom));
|
---|
56 | if( maxZoom < 30 )
|
---|
57 | map.put("maxzoom", String.valueOf(maxZoom));
|
---|
58 | }
|
---|
59 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.