Skip to content

Commit

Permalink
[Bromley] Add functions and tests for Crystal Palace Park layer
Browse files Browse the repository at this point in the history
Adds functions for Bromley road found/not_found

Adds test for layer
  • Loading branch information
MorayMySoc committed Oct 25, 2023
1 parent a2d331a commit abd9d80
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .cypress/cypress/fixtures/crystal_palace_park.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version='1.0' encoding="UTF-8" ?>
<wfs:FeatureCollection
xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:gml="http://www.opengis.net/gml"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver https://tilma.staging.mysociety.org:80/mapserver/bromley_wfs?SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=Crystal_Palace_Park&amp;OUTPUTFORMAT=text/xml;%20subtype=gml/3.1.1 http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:3857">
<gml:lowerCorner>-8722.507321 6695348.198220</gml:lowerCorner>
<gml:upperCorner>-6855.074244 6697037.711273</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<gml:featureMember>
<ms:Crystal_Palace_Park gml:id="Crystal_Palace_Park.1154">
<gml:boundedBy>
<gml:Envelope srsName="EPSG:3857">
<gml:lowerCorner>-8722.507321 6695348.198220</gml:lowerCorner>
<gml:upperCorner>-6855.074244 6697037.711273</gml:upperCorner>
</gml:Envelope>
</gml:boundedBy>
<ms:msGeometry>
<gml:Polygon srsName="EPSG:3857">
<gml:exterior>
<gml:LinearRing>
<gml:posList srsDimension="2">-7872.866417 6696946.669515 -7850.712464 6696942.713108 -7847.284280 6696966.544287 -7806.863460 6696941.715800 -7773.534050 6696921.248725 -7734.136925 6696897.089235 -7568.118686 6696795.330569 -7484.517230 6696744.058739 -7424.017001 6696706.671947 -7394.165201 6696748.827667 -7347.084064 6696712.502968 -7369.452958 6696674.805344 -7283.851933 6696611.533696 -7231.608901 6696572.323815 -7211.637496 6696556.803686 -7186.068312 6696591.365298 -7133.707874 6696542.779417 -7091.511019 6696497.103649 -7053.855879 6696451.660644 -6998.166059 6696372.404151 -7038.056825 6696347.293918 -7030.384350 6696334.649007 -7038.919382 6696327.329999 -7009.411238 6696279.912313 -6970.834174 6696197.867954 -6942.945391 6696154.041468 -6929.684262 6696120.796760 -6888.076800 6696133.322645 -6868.859583 6696057.603900 -6865.544838 6696034.560095 -6861.039790 6695971.673429 -6935.641431 6695968.996369 -6925.148680 6695774.961715 -6937.788235 6695741.907618 -6855.074244 6695706.244888 -6859.557986 6695698.082376 -6905.432252 6695672.666452 -6948.479101 6695652.217419 -6957.123253 6695649.236122 -6989.151879 6695712.689331 -7072.771515 6695674.533612 -7072.451685 6695635.036472 -7055.862880 6695599.282016 -7192.749094 6695520.319907 -7316.550331 6695430.496013 -7353.133007 6695400.082779 -7395.688339 6695373.658878 -7418.457624 6695348.198220 -7488.688824 6695352.882480 -7523.529856 6695355.167750 -7621.750712 6695370.280863 -7641.982533 6695377.543520 -7727.707046 6695414.399966 -7749.585431 6695428.239396 -7772.937445 6695443.858692 -7802.007737 6695459.541786 -7841.852511 6695509.070730 -7928.307673 6695551.723668 -8011.926292 6695610.621327 -8096.341380 6695664.348222 -8175.782737 6695696.781615 -8237.947142 6695652.349888 -8255.919165 6695681.011370 -8294.731637 6695718.647563 -8329.183611 6695748.441264 -8359.371537 6695771.703992 -8379.891583 6695771.024383 -8543.561543 6695864.954706 -8560.554271 6695875.627417 -8580.139911 6695885.854650 -8614.981667 6695904.050724 -8691.407468 6695920.504240 -8694.881819 6695943.050949 -8722.507321 6695948.914278 -8721.195704 6695972.346605 -8715.859111 6695997.411844 -8714.711121 6696004.998094 -8657.080204 6696010.361889 -8615.970247 6696100.670569 -8654.242158 6696146.979400 -8608.772040 6696271.591123 -8588.669368 6696300.169573 -8535.151477 6696432.310687 -8497.287838 6696527.841096 -8441.627925 6696666.020604 -8417.928058 6696724.155335 -8349.109286 6696894.426589 -8336.079069 6696926.775596 -8297.116128 6696962.354041 -8270.235875 6696982.918439 -8237.868571 6697005.104231 -8220.807861 6697014.528354 -8204.576581 6697019.800028 -8179.630401 6697018.500224 -8147.022409 6697025.427182 -8114.199587 6697031.385052 -8089.876665 6697033.794051 -8054.388169 6697037.594234 -8023.428352 6697037.711273 -7998.341339 6697037.640863 -8003.746186 6696999.492411 -7995.896858 6696956.900450 -7958.724303 6696951.665038 -7946.339248 6697033.057632 -7928.270076 6697030.911179 -7895.726036 6697024.870263 -7855.728616 6697013.888366 -7858.691334 6696998.634131 -7864.864791 6696992.214608 -7872.866417 6696946.669515 </gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</ms:msGeometry>
</ms:Crystal_Palace_Park>
</gml:featureMember>
</wfs:FeatureCollection>
10 changes: 10 additions & 0 deletions .cypress/cypress/integration/bromley.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ describe('Bromley cobrand', function() {
cy.server();
cy.route('**mapserver/bromley*Streetlights*', 'fixture:bromley-lights.xml').as('lights');
cy.route('**mapserver/bromley*PROW*', 'fixture:bromley-prow.xml').as('prow');
cy.route('**mapserver/bromley*Crystal_Palace*', 'fixture:crystal_palace_park.xml').as('crystal');
cy.route('/report/new/ajax*').as('report-ajax');
cy.viewport(480, 800);
cy.visit('http://bromley.localhost:3001/report/new?latitude=51.4021&longitude=0.01578');
cy.contains('Bromley');
cy.wait('@prow');
cy.wait('@crystal');
cy.wait('@report-ajax');
cy.get('#mob_ok').click();
});
Expand Down Expand Up @@ -41,4 +43,12 @@ describe('Bromley cobrand', function() {
cy.get('.mobile-map-banner').should('be.visible');
});

it('adds stopper for Crystal Palace Park', function() {
cy.visit('http://bromley.localhost:3001/report/new?longitude=-0.064555&latitude=51.422382');
cy.wait('@crystal');
cy.wait('@report-ajax');
cy.contains('transferred to the Crystal Palace Park Trust');
cy.get('#mob_ok').should('not.be.visible');
});

});
11 changes: 11 additions & 0 deletions data/test-asset-layers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,17 @@ bromley:
usrn:
attribute: 'PROW_REFER'
field: 'prow_reference'
- wfs_feature: "Crystal_Palace_Park"
asset_type: 'area'
always_visible: true
road: true
non_interactive: true
stylemap: fixmystreet.assets.stylemap_invisible
all_categories: true
no_asset_message: "<p>The Management of Crystal Palace Park has transferred to the Crystal Palace Park Trust who are now responsible for the day-to-day management and maintenance of the park, as well as any community or commercial events and concession agreements within the park. Their website can be found at: <a href='https://www.crystalpalaceparktrust.org/'>https://www.crystalpalaceparktrust.org</a> where any issues or queries regarding the park can be submitted.</p>"
actions:
found: fixmystreet.assets.bromley.found
not_found: fixmystreet.assets.bromley.not_found
buckinghamshire:
- - name: 'default'
http_wfs_url: "https://tilma.staging.mysociety.org/mapserver/bucks"
Expand Down
1 change: 1 addition & 0 deletions t/Mock/MapIt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ my @PLACES = (
[ 'BR1 3UH', 51.402092, 0.015783, 2482, 'Bromley Council', 'LBO', 8141, 'Bromley Town', 'LBW' ],
[ 'BR1 3EF', 51.4039, 0.018697, 2482, 'Bromley Council', 'LBO' ],
[ 'BR1 1AA', 51.401546, 0.015415, 2482, 'Bromley Council', 'LBO' ],
[ '?', 51.422382, -0.064555, 2482, 'Bromley Council', 'LBO' ],
[ 'KT1 1AA', 51.408688, -0.304465, 2480, 'Kingston upon Thames Council', 'LBO' ],
[ 'SM2 5HF', 51.354679, -0.183895, 2498, 'Sutton Borough Council', 'LBO' ],
[ '?', 51.466707, 0.181108, 2494, 'London Borough of Bexley', 'LBO' ],
Expand Down
8 changes: 8 additions & 0 deletions web/cobrands/fixmystreet-uk-councils/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,14 @@ fixmystreet.assets.bromley.prow_stylemap = new OpenLayers.StyleMap({
})
});

fixmystreet.assets.bromley.found = function(layer) {
fixmystreet.message_controller.road_not_found(layer, function() {return true;});
};

fixmystreet.assets.bromley.not_found = function(layer) {
fixmystreet.message_controller.road_found(layer);
};

/* Buckinghamshire */

fixmystreet.assets.buckinghamshire = {};
Expand Down

0 comments on commit abd9d80

Please sign in to comment.