1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
/*
* Maps for FMZ using Zurich council's WMTS tile server
*/
// From 'fullExtent' from http://www.gis.stadt-zuerich.ch/maps/rest/services/tiled95/LuftbildHybrid/MapServer?f=pjson
fixmystreet.maps.layer_bounds = new OpenLayers.Bounds(
2676000.9069999997, // W
1241399.842, // S
2689900.9069999997, // E
1254599.842); // N
fixmystreet.maps.matrix_ids = [
// The two highest zoom levels are pretty much useless so they're disabled.
// {
// "matrixHeight": 882,
// "scaleDenominator": 241905.24571522293,
// "identifier": "0",
// "tileWidth": 512,
// "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
// "tileHeight": 512,
// "matrixWidth": 868
// },
// {
// "matrixHeight": 1764,
// "scaleDenominator": 120952.62285761147,
// "identifier": "1",
// "tileWidth": 512,
// "supportedCRS": "urn:ogc:def:crs:EPSG::2056",
// "tileHeight": 512,
// "matrixWidth": 1735
// },
{
"matrixHeight": 3527,
"scaleDenominator": 60476.31142880573,
"identifier": "2",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 3470
},
{
"matrixHeight": 7053,
"scaleDenominator": 30238.155714402867,
"identifier": "3",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 6939
},
{
"matrixHeight": 14106,
"scaleDenominator": 15119.077857201433,
"identifier": "4",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 13877
},
{
"matrixHeight": 28211,
"scaleDenominator": 7559.538928600717,
"identifier": "5",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 27753
},
{
"matrixHeight": 56422,
"scaleDenominator": 3779.7694643003583,
"identifier": "6",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 55505
},
{
"matrixHeight": 112844,
"scaleDenominator": 1889.8847321501792,
"identifier": "7",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 111010
},
{
"matrixHeight": 225687,
"scaleDenominator": 944.9423660750896,
"identifier": "8",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 222020
},
{
"matrixHeight": 451374,
"scaleDenominator": 472.4711830375448,
"identifier": "9",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 444039
},
{
"matrixHeight": 902748,
"scaleDenominator": 236.2355915187724,
"identifier": "10",
"tileWidth": 512,
"supportedCRS": "urn:ogc:def:crs:EPSG::2056",
"tileHeight": 512,
"matrixWidth": 888078
}
];
(function() {
function pin_dragged(lonlat) {
document.getElementById('fixmystreet.latitude').value = lonlat.y;
document.getElementById('fixmystreet.longitude').value = lonlat.x;
}
$(function(){
$('#map_layer_toggle').toggle(function(){
$(this).text('Luftbild');
fixmystreet.map.setBaseLayer(fixmystreet.map.layers[1]);
}, function(){
$(this).text('Stadtplan');
fixmystreet.map.setBaseLayer(fixmystreet.map.layers[0]);
});
/* Admin dragging of pin */
if (fixmystreet.page == 'admin') {
if ($.browser.msie) {
$(window).load(function() { fixmystreet.maps.admin_drag(pin_dragged, true); });
} else {
fixmystreet.maps.admin_drag(pin_dragged, true);
}
}
});
})();
/*
* maps.config() is called on dom ready in map-OpenLayers.js
* to setup the way the map should operate.
*/
fixmystreet.maps.config = function() {
// This stuff is copied from js/map-bing-ol.js
fixmystreet.controls = [
new OpenLayers.Control.ArgParser(),
new OpenLayers.Control.Navigation()
];
if ( fixmystreet.page != 'report' || !$('html').hasClass('mobile') ) {
fixmystreet.controls.push( new OpenLayers.Control.PanZoomFMS({id: 'fms_pan_zoom' }) );
}
/* Linking back to around from report page, keeping track of map moves */
if ( fixmystreet.page == 'report' ) {
fixmystreet.controls.push( new OpenLayers.Control.PermalinkFMS('key-tool-problems-nearby', '/around') );
}
this.setup_wmts_base_map();
fixmystreet.area_format = { fillColor: 'none', strokeWidth: 4, strokeColor: 'black' };
};
fixmystreet.maps.marker_size = function() {
var zoom = fixmystreet.map.getZoom() + fixmystreet.zoomOffset;
if (zoom >= 6) {
return 'normal';
} else if (zoom >= 3) {
return 'small';
} else {
return 'mini';
}
};
|