diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/assets.js | 26 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 9 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/staff.js | 29 | ||||
-rw-r--r-- | web/cobrands/isleofwight/_colours.scss | 31 | ||||
-rw-r--r-- | web/cobrands/isleofwight/assets.js | 311 | ||||
-rw-r--r-- | web/cobrands/isleofwight/base.scss | 18 | ||||
l--------- | web/cobrands/isleofwight/images/email-logo.gif | 1 | ||||
-rw-r--r-- | web/cobrands/isleofwight/images/logo.gif | bin | 0 -> 4924 bytes | |||
-rw-r--r-- | web/cobrands/isleofwight/js.js | 33 | ||||
-rw-r--r-- | web/cobrands/isleofwight/layout.scss | 26 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 2 | ||||
-rw-r--r-- | web/js/map-wmts-isleofwight.js | 206 |
12 files changed, 674 insertions, 18 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js index fd18bb34a..0b2205076 100644 --- a/web/cobrands/fixmystreet/assets.js +++ b/web/cobrands/fixmystreet/assets.js @@ -71,7 +71,7 @@ OpenLayers.Layer.VectorAsset = OpenLayers.Class(OpenLayers.Layer.Vector, { if (!fixmystreet.markers.getVisibility() || !(this.getVisibility() && this.inRange)) { return; } - var threshold = 50; // metres + var threshold = this.fixmystreet.snap_threshold || 50; // metres var marker = fixmystreet.markers.features[0]; if (marker === undefined) { // No marker to be found so bail out @@ -375,7 +375,7 @@ function clear_fields_for_attributes(attributes) { } function check_zoom_message_visibility() { - if (this.fixmystreet.non_interactive) { + if (this.fixmystreet.non_interactive && !this.fixmystreet.display_zoom_message) { return; } var select = this.fixmystreet.asset_group ? 'category_group' : 'form_category'; @@ -419,6 +419,9 @@ function layer_visibilitychanged() { if (!this.getVisibility()) { this.road_not_found(); } + if (this.fixmystreet.display_zoom_message) { + check_zoom_message_visibility.call(this); + } return; } else if (!this.getVisibility()) { asset_unselected.call(this); @@ -1021,6 +1024,7 @@ fixmystreet.message_controller = (function() { var stopperId = 'js-category-stopper', stoppers = [], ignored_bodies = []; + msg_after_bodies = []; // This shows an error message because e.g. an asset isn't selected or a road hasn't been clicked function show_responsibility_error(id, asset_item, asset_type) { @@ -1119,6 +1123,14 @@ fixmystreet.message_controller = (function() { } } + function stopper_after(stopper) { + var body = fixmystreet.bodies[0]; + if (OpenLayers.Util.indexOf( msg_after_bodies, body) > -1 ) { + return true; + } + return false; + } + function check_for_stopper() { var only_send = fixmystreet.body_overrides.get_only_send(); if (only_send == 'Highways England') { @@ -1150,7 +1162,11 @@ fixmystreet.message_controller = (function() { if ($id.length) { $id.replaceWith($msg); } else { - $msg.insertBefore('#js-post-category-messages'); + if (stopper_after(stopper)) { + $msg.insertAfter('#js-post-category-messages'); + } else { + $msg.insertBefore('#js-post-category-messages'); + } } disable_report_form(stopper.keep_category_extras); } @@ -1225,6 +1241,10 @@ fixmystreet.message_controller = (function() { add_ignored_body: function(body) { ignored_bodies.push(body); + }, + + add_msg_after_bodies: function(body) { + msg_after_bodies.push(body); } }; diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 24b8a6d0f..cda196864 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -1510,7 +1510,12 @@ fixmystreet.display = { window.selected_problem_id = reportId; var marker = fixmystreet.maps.get_marker_by_id(reportId); - if (fixmystreet.map.panTo && ($('html').hasClass('mobile') || !marker.onScreen())) { + var el = document.querySelector('input[name=triage]'); + if (el) { + fixmystreet.map.setCenter( + marker.geometry.getBounds().getCenterLonLat(), + fixmystreet.map.getNumZoomLevels() - 1 ); + } else if (fixmystreet.map.panTo && ($('html').hasClass('mobile') || !marker.onScreen())) { fixmystreet.map.panTo( marker.geometry.getBounds().getCenterLonLat() ); @@ -1526,8 +1531,10 @@ fixmystreet.display = { if (fixmystreet.maps.setup_inspector) { fixmystreet.maps.setup_inspector(); + fixmystreet.map.updateSize(); } + if (typeof callback === 'function') { callback(); } diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js index b074a49f3..17bd54b8b 100644 --- a/web/cobrands/fixmystreet/staff.js +++ b/web/cobrands/fixmystreet/staff.js @@ -261,19 +261,22 @@ fixmystreet.staff_set_up = { if ('geolocation' in navigator) { var el = document.querySelector('.btn--geolocate'); - fixmystreet.geolocate(el, function(pos) { - var latlon = new OpenLayers.LonLat(pos.coords.longitude, pos.coords.latitude); - var bng = latlon.clone().transform( - new OpenLayers.Projection("EPSG:4326"), - new OpenLayers.Projection("EPSG:27700") // TODO: Handle other projections - ); - $("#problem_northing").text(bng.lat.toFixed(1)); - $("#problem_easting").text(bng.lon.toFixed(1)); - $("#problem_latitude").text(latlon.lat.toFixed(6)); - $("#problem_longitude").text(latlon.lon.toFixed(6)); - $inspect_form.find("input[name=latitude]").val(latlon.lat); - $inspect_form.find("input[name=longitude]").val(latlon.lon); - }); + // triage pages may not show geolocation button + if (el) { + fixmystreet.geolocate(el, function(pos) { + var latlon = new OpenLayers.LonLat(pos.coords.longitude, pos.coords.latitude); + var bng = latlon.clone().transform( + new OpenLayers.Projection("EPSG:4326"), + new OpenLayers.Projection("EPSG:27700") // TODO: Handle other projections + ); + $("#problem_northing").text(bng.lat.toFixed(1)); + $("#problem_easting").text(bng.lon.toFixed(1)); + $("#problem_latitude").text(latlon.lat.toFixed(6)); + $("#problem_longitude").text(latlon.lon.toFixed(6)); + $inspect_form.find("input[name=latitude]").val(latlon.lat); + $inspect_form.find("input[name=longitude]").val(latlon.lon); + }); + } } // Make the "Provide an update" form toggleable, hidden by default. diff --git a/web/cobrands/isleofwight/_colours.scss b/web/cobrands/isleofwight/_colours.scss new file mode 100644 index 000000000..688eb66e0 --- /dev/null +++ b/web/cobrands/isleofwight/_colours.scss @@ -0,0 +1,31 @@ +/* COLOURS */ + +$menu-image: 'menu-black'; + +$mappage-header-height: 124px; + +$blue: #00478c; +$cyan: #00aeef; // + 60 25 +$orange: #fcaf17; +$green: #75c044; + +//Any 20% tint of the above + +$primary_text: #fff; +$primary: $cyan; +$primary_b: #222; + +$base_bg: #fff; +$base_fg: #222; + +$nav_background_colour: #fff; +$nav_colour: $blue; +$nav_hover_background_colour: $cyan; + +$col_click_map: $green; + +$header-top-border: false; + +$body-font: Helvetica, Arial, sans-serif; +$heading-font: $body-font; +$meta-font: $body-font; diff --git a/web/cobrands/isleofwight/assets.js b/web/cobrands/isleofwight/assets.js new file mode 100644 index 000000000..a68b0418b --- /dev/null +++ b/web/cobrands/isleofwight/assets.js @@ -0,0 +1,311 @@ +(function(){ + +if (!fixmystreet.maps) { + return; +} + +var defaults = { + http_options: { + url: "https://tilma.staging.mysociety.org/mapserver/iow", + params: { + SERVICE: "WFS", + VERSION: "1.1.0", + REQUEST: "GetFeature", + SRSNAME: "urn:ogc:def:crs:EPSG::27700" + } + }, + format_class: OpenLayers.Format.GML.v3.MultiCurveFix, + max_resolution: { + 'isleofwight': 0.5291677250021167, + 'fixmystreet': 1.194328566789627 + }, + attributes: { + central_asset_id: 'central_asset_id', + site_code: 'site_code' + }, + min_resolution: 0.00001, + asset_id_field: 'asset_id', + geometryName: 'msGeometry', + srsName: "EPSG:27700", + strategy_class: OpenLayers.Strategy.FixMyStreet, + body: "Isle of Wight Council" +}; + +var pin_prefix = fixmystreet.pin_prefix || document.getElementById('js-map-data').getAttribute('data-pin_prefix'); + +var labeled_default = { + fillColor: "#FFFF00", + fillOpacity: 0.6, + strokeColor: "#000000", + strokeOpacity: 0.8, + strokeWidth: 2, + pointRadius: 6 +}; + +var labeled_select = { + externalGraphic: pin_prefix + "pin-spot.png", + fillColor: "#55BB00", + graphicWidth: 48, + graphicHeight: 64, + graphicXOffset: -24, + graphicYOffset: -56, + backgroundGraphic: pin_prefix + "pin-shadow.png", + backgroundWidth: 60, + backgroundHeight: 30, + backgroundXOffset: -7, + backgroundYOffset: -22, + popupYOffset: -40, + graphicOpacity: 1.0, + + label: "${asset_id}", + labelOutlineColor: "white", + labelOutlineWidth: 3, + labelYOffset: 65, + fontSize: '15px', + fontWeight: 'bold' +}; + +var labeled_stylemap = new OpenLayers.StyleMap({ + 'default': new OpenLayers.Style(labeled_default), + 'select': new OpenLayers.Style(labeled_select) +}); + +fixmystreet.assets.add($.extend(true, {}, defaults, { + http_options: { + params: { + TYPENAME: "streets" + } + }, + always_visible: true, + non_interactive: true, + asset_type: 'area', + max_resolution: { + 'isleofwight': 6.614596562526458, + 'fixmystreet': 4.777314267158508 + }, + usrn: { + attribute: 'SITE_CODE', + field: 'site_code' + }, + stylemap: new OpenLayers.StyleMap({ + 'default': new OpenLayers.Style({ + fill: false, + strokeColor: "#5555FF", + strokeOpacity: 0.1, + strokeWidth: 7 + }) + }) +})); + +function not_found_msg_update() { + $('.category_meta_message').html('Please select an item or a road/pavement/path on the map »'); + $('.category_meta_message').removeClass('meta-highlight'); + $("input[name=asset_details]").val(''); +} + +function found_item(layer, asset) { + var id = asset.attributes.central_asset_id || ''; + if (id !== '') { + var attrib = asset.attributes; + var asset_name = attrib.feature_type_name + '; ' + attrib.site_name + '; ' + attrib.feature_location; + $('.category_meta_message').html('You have selected ' + asset_name); + $('.category_meta_message').addClass('meta-highlight'); + $("input[name=asset_details]").val(asset_name); + } else { + not_found_msg_update(); + } +} + + +var point_asset_defaults = $.extend(true, {}, defaults, { + snap_threshold: 5, + select_action: true, + asset_type: 'spot', + asset_item: "item", + actions: { + asset_found: function(asset) { + found_item(this, asset); + }, + asset_not_found: function() { + not_found_msg_update(); + } + } + +}); + +var line_asset_defaults = $.extend(true, {}, defaults, { + display_zoom_message: true, + non_interactive: true, + road: true, + stylemap: fixmystreet.assets.stylemap_invisible, + usrn: { + attribute: 'site_code', + field: 'site_code' + }, + asset_item: 'road', + actions: { + found: function(layer, feature) { + if ( fixmystreet.assets.selectedFeature() ) { + return; + } + found_item(layer, feature); + }, + not_found: function(layer) { + if ( fixmystreet.assets.selectedFeature() ) { + return; + } + not_found_msg_update(); + } + } +}); + + +var point_category_list = [ + //"Dog Fouling", + "Manholes", + "Trees & Hedges", + //"Pavements/footpaths", + //"Drainage", + //"Car Parking", + "Street Lighting", + "Bus Stops", + //"Flyposting", + //"Potholes", + //"Street Cleaning", + "Bridges & Walls", + "Traffic Lights", + "Street Furniture", + //"Roads/Highways", + "Road Traffic Signs & Markings", + "Grass Verges & Weeds", + //"Flytipping", + //"Graffiti", + "Street Nameplates", + //"Abandoned Vehicles" +]; + +var line_category_list = [ + "Dog Fouling", + "Drainage", + "Car Parking", + "Pavements/footpaths", + "Potholes", + "Street Cleaning", + "Roads/Highways", + "Flytipping", + "Abandoned Vehicles" +]; + +var layer_map = { + "Dog Fouling": "Dog_Fouling", + "Drainage": "Drainage_line", + "Car Parking": "Car_Parks", + "Trees & Hedges": "Trees_Hedges", + "Pavements/footpaths": "Pavements_footpaths", + "Street Lighting": "Street_Lighting", + "Bus Stops": "Bus_Stops", + "Street Cleaning": "Street_Cleaning", + "Bridges & Walls": "Bridges_Walls", + "Traffic Lights": "Traffic_Lights", + "Street Furniture": "Street_Furniture", + "Roads/Highways": "Roads_Highways", + "Road Traffic Signs & Markings": "Road_Traffic_Signs_Markings", + "Grass Verges & Weeds": "Grass_Verges_Weeds", + "Street Nameplates": "Street_Nameplates", + "Abandoned Vehicles": "Abandoned_Vehicles" +}; + +for (i = 0; i < point_category_list.length; i++) { + cat = point_category_list[i]; + layer = layer_map[cat] || cat; + + fixmystreet.assets.add($.extend(true, {}, point_asset_defaults, { + asset_group: cat, + http_options: { + params: { + TYPENAME: layer + } + } + })); +} + +for (i = 0; i < line_category_list.length; i++) { + cat = line_category_list[i]; + layer = layer_map[cat] || cat; + + fixmystreet.assets.add($.extend(true, {}, line_asset_defaults, { + asset_group: cat, + asset_category: [ + cat + ], + http_options: { + params: { + TYPENAME: layer + } + } + })); +} + +// non union layers +fixmystreet.assets.add($.extend(true, {}, point_asset_defaults, { + asset_group: "Roads/Highways", + http_options: { + params: { + TYPENAME: "Fords" + } + } +})); + +fixmystreet.assets.add($.extend(true, {}, point_asset_defaults, { + asset_group: "Roads/Highways", + http_options: { + params: { + TYPENAME: "Furn-Grid_and_Stones" + } + } +})); + + +fixmystreet.assets.add($.extend(true, {}, point_asset_defaults, { + asset_group: "Drainage", + http_options: { + params: { + TYPENAME: "Drainage_spot" + } + } +})); + +fixmystreet.assets.add($.extend(true, {}, point_asset_defaults, { + asset_group: "Car Parking", + http_options: { + params: { + TYPENAME: "Car_Parking" + } + } +})); + +fixmystreet.assets.add($.extend(true, {}, line_asset_defaults, { + asset_group: "Grass Verges & Weeds", + asset_category: [ + "Grass Verges & Weeds" + ], + http_options: { + params: { + TYPENAME: "Verges-Natural" + } + } +})); + +fixmystreet.assets.add($.extend(true, {}, point_asset_defaults, { + asset_group: "Dog Fouling", + http_options: { + params: { + TYPENAME: "Furn-Bins" + } + } +})); + +fixmystreet.message_controller.add_msg_after_bodies(defaults.body); + + +})(); diff --git a/web/cobrands/isleofwight/base.scss b/web/cobrands/isleofwight/base.scss new file mode 100644 index 000000000..aae8e9f7c --- /dev/null +++ b/web/cobrands/isleofwight/base.scss @@ -0,0 +1,18 @@ +@import "../sass/h5bp"; +@import "./_colours"; +@import "../sass/mixins"; +@import "../sass/base"; + +/* Header */ + +#site-logo { + width: 141px; + height: 38px; + padding: 1em 0; + background: url(/cobrands/isleofwight/images/logo.gif) 0 50% no-repeat; + background-size: 141px 38px; +} + +#map_box #map { + background-color: white; +} diff --git a/web/cobrands/isleofwight/images/email-logo.gif b/web/cobrands/isleofwight/images/email-logo.gif new file mode 120000 index 000000000..94a12010e --- /dev/null +++ b/web/cobrands/isleofwight/images/email-logo.gif @@ -0,0 +1 @@ +logo.gif
\ No newline at end of file diff --git a/web/cobrands/isleofwight/images/logo.gif b/web/cobrands/isleofwight/images/logo.gif Binary files differnew file mode 100644 index 000000000..7238ca8a3 --- /dev/null +++ b/web/cobrands/isleofwight/images/logo.gif diff --git a/web/cobrands/isleofwight/js.js b/web/cobrands/isleofwight/js.js new file mode 100644 index 000000000..d43006fd5 --- /dev/null +++ b/web/cobrands/isleofwight/js.js @@ -0,0 +1,33 @@ +(function(){ + +if (!fixmystreet.maps) { + return; +} + +if (fixmystreet.cobrand == 'isleofwight') { + // We want the cobranded site to always display "Island Roads" + // as the destination for reports in the "Public details" section. + // This is OK because the cobranded site only shows categories which + // Island Roads actually handle. + // To achieve this we ignore the passed list of bodies and always + // use "Island Roads" when calling the original function. + // NB calling the original function is required so that private categories + // cause the correct text to be shown in the UI. + var original_update_public_councils_text = fixmystreet.update_public_councils_text; + fixmystreet.update_public_councils_text = function(text, bodies) { + original_update_public_councils_text.call(this, text, ['Island Roads']); + }; +} + +var org_id = '1062'; +var body = "Isle of Wight Council"; +fixmystreet.assets.add(fixmystreet.roadworks.layer_future, { + http_options: { params: { organisation_id: org_id } }, + body: body +}); +fixmystreet.assets.add(fixmystreet.roadworks.layer_planned, { + http_options: { params: { organisation_id: org_id } }, + body: body +}); + +})(); diff --git a/web/cobrands/isleofwight/layout.scss b/web/cobrands/isleofwight/layout.scss new file mode 100644 index 000000000..924092a86 --- /dev/null +++ b/web/cobrands/isleofwight/layout.scss @@ -0,0 +1,26 @@ +@import "_colours"; + +@import "../sass/layout"; + +body.twothirdswidthpage .content .sticky-sidebar aside { + top: 10em; +} + +#site-logo { + width: 282px; + height: 76px; + padding: 24px 0; + background-position: 0px 50%; + background-size: 282px 76px; +} + +.mappage #site-header { + box-sizing: border-box; + border-bottom: solid 5px $cyan; +} + +.meta-highlight { + margin: 1em -1em; + padding: 2em 2em; + background-color: mix(#fff, $primary, 70%); +} diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 4e4201d3a..1588bda2e 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -676,7 +676,7 @@ $.extend(fixmystreet.utils, { styleMap: pin_layer_style_map }; if (fixmystreet.page == 'around') { - fixmystreet.bbox_strategy = fixmystreet.bbox_strategy || new OpenLayers.Strategy.FixMyStreet(); + fixmystreet.bbox_strategy = fixmystreet.map_bbox_strategy || new OpenLayers.Strategy.FixMyStreet(); pin_layer_options.strategies = [ fixmystreet.bbox_strategy ]; } if (fixmystreet.page == 'reports') { diff --git a/web/js/map-wmts-isleofwight.js b/web/js/map-wmts-isleofwight.js new file mode 100644 index 000000000..464bee913 --- /dev/null +++ b/web/js/map-wmts-isleofwight.js @@ -0,0 +1,206 @@ +/* + * Maps for FMS using Island Roads' WMTS tile server + */ + +fixmystreet.maps.layer_bounds = new OpenLayers.Bounds( + 428576.1131782566, + 70608.46901095579, + 468137.51522498735, + 101069.6062942903 +); + +fixmystreet.maps.matrix_ids = [ + // The first 5 levels don't load and are really zoomed-out, so + // they're not included here. + //{ + //"identifier": 0, + //"scaleDenominator": 566965.4196450538, + //"supportedCRS": "urn:ogc:def:crs:EPSG:27700", + //"tileWidth": 256, + //"tileHeight": 256, + //"matrixWidth": 140, + //"matrixHeight": 109 + //}, + //{ + //"identifier": 1, + //"scaleDenominator": 472471.18303754483, + //"supportedCRS": "urn:ogc:def:crs:EPSG:27700", + //"tileWidth": 256, + //"tileHeight": 256, + //"matrixWidth": 168, + //"matrixHeight": 130 + //}, + //{ + //"identifier": 2, + //"scaleDenominator": 377976.9464300358, + //"supportedCRS": "urn:ogc:def:crs:EPSG:27700", + //"tileWidth": 256, + //"tileHeight": 256, + //"matrixWidth": 210, + //"matrixHeight": 163 + //}, + //{ + //"identifier": 3, + //"scaleDenominator": 283482.7098225269, + //"supportedCRS": "urn:ogc:def:crs:EPSG:27700", + //"tileWidth": 256, + //"tileHeight": 256, + //"matrixWidth": 280, + //"matrixHeight": 217 + //}, + //{ + //"identifier": 4, + //"scaleDenominator": 188988.4732150179, + //"supportedCRS": "urn:ogc:def:crs:EPSG:27700", + //"tileWidth": 256, + //"tileHeight": 256, + //"matrixWidth": 420, + //"matrixHeight": 325 + //}, + { + "identifier": 5, + "scaleDenominator": 94494.23660750895, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 840, + "matrixHeight": 650 + }, + { + "identifier": 6, + "scaleDenominator": 70870.67745563173, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 1120, + "matrixHeight": 867 + }, + { + "identifier": 7, + "scaleDenominator": 47247.118303754476, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 1680, + "matrixHeight": 1300 + }, + { + "identifier": 8, + "scaleDenominator": 23623.559151877238, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 3360, + "matrixHeight": 2599 + }, + { + "identifier": 9, + "scaleDenominator": 9449.423660750896, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 8399, + "matrixHeight": 6496 + }, + { + "identifier": 10, + "scaleDenominator": 7559.538928600717, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 10499, + "matrixHeight": 8120 + }, + { + "identifier": 11, + "scaleDenominator": 5669.654196450538, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 13998, + "matrixHeight": 10826 + }, + { + "identifier": 12, + "scaleDenominator": 3779.7694643003583, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 20997, + "matrixHeight": 16239 + }, + { + "identifier": 13, + "scaleDenominator": 1889.8847321501792, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 41993, + "matrixHeight": 32478 + }, + { + "identifier": 14, + "scaleDenominator": 944.9423660750896, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 83985, + "matrixHeight": 64955 + }, + { + "identifier": 15, + "scaleDenominator": 377.9769464300358, + "supportedCRS": "urn:ogc:def:crs:EPSG:27700", + "tileWidth": 256, + "tileHeight": 256, + "matrixWidth": 209961, + "matrixHeight": 162387 + } +]; + +/* + * maps.config() is called on dom ready in map-OpenLayers.js + * to setup the way the map should operate. + */ +fixmystreet.maps.config = function() { + var permalink_id; + if ($('#map_permalink').length) { + permalink_id = 'map_permalink'; + } + + fixmystreet.controls = [ + new OpenLayers.Control.ArgParserFMS(), + new OpenLayers.Control.Navigation(), + new OpenLayers.Control.PermalinkFMS(permalink_id), + 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.maps.marker_size = function() { + var zoom = fixmystreet.map.getZoom() + fixmystreet.zoomOffset; + if (zoom >= 7) { + return 'normal'; + } else if (zoom >= 4) { + return 'small'; + } else { + return 'mini'; + } +}; + +fixmystreet.maps.selected_marker_size = function() { + var zoom = fixmystreet.map.getZoom() + fixmystreet.zoomOffset; + if (zoom >= 7) { + return 'big'; + } else if (zoom >= 4) { + return 'normal'; + } else { + return 'small'; + } +}; |