diff options
25 files changed, 947 insertions, 99 deletions
diff --git a/conf/crontab.ugly b/conf/crontab.ugly index 7c01ab8b3..7a2ab1891 100644 --- a/conf/crontab.ugly +++ b/conf/crontab.ugly @@ -47,10 +47,9 @@ my %no_alerts = map { $_ => 1 } @no_alerts; # Open311 sending and fetching of updates 5,10,15,20,25,30,35,40,45,50,55 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-comments.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper send-comments" || echo "stalled?" -5,10,15,20,25,30,35,40,45,50,55 0-7,9-23 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/fetch-comments.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper fetch-comments" || echo "stalled?" -10,15,20,25,30,35,40,45,50,55 8 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/fetch-comments.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper fetch-comments" || echo "stalled?" -5 8 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/fetch-comments.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper fetch-comments --verbose" || echo "stalled?" -5 1 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/fetch-comments.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper fetch-comments-24hs" || echo "stalled?" +5,10,15,20,25,30,35,40,45,50,55 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/fetch-comments.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper fetch-comments" || echo "stalled?" +0 8 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/fetch-comments.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper fetch-comments --verbose" || echo "stalled?" +0 1 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/fetch-comments.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper fetch-comments-24hs" || echo "stalled?" # Open311 service list population 30 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/open311-populate-service-list.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper open311-populate-service-list" || echo "stalled?" diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 7c985fdfc..de69880c1 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -485,7 +485,7 @@ sub reports : Path('reports') { my ( $self, $c ) = @_; if (my $search = $c->req->param('search')) { - $c->stash->{searched} = 1; + $c->stash->{searched} = $search; my $site_restriction = $c->cobrand->site_restriction; @@ -730,11 +730,9 @@ sub users: Path('users') : Args(0) { my ( $self, $c ) = @_; if (my $search = $c->req->param('search')) { - $c->stash->{searched} = 1; + $c->stash->{searched} = $search; - my $search = $c->req->param('search'); my $isearch = '%' . $search . '%'; - my $search_n = 0; $search_n = int($search) if $search =~ /^\d+$/; @@ -765,6 +763,9 @@ sub users: Path('users') : Args(0) { } } + } else { + $c->forward('get_token'); + $c->forward('fetch_all_bodies'); } return 1; @@ -875,6 +876,35 @@ sub update_edit : Path('update_edit') : Args(1) { return 1; } +sub user_add : Path('user_edit') : Args(0) { + my ( $self, $c ) = @_; + + $c->stash->{template} = 'admin/user_edit.html'; + $c->forward('get_token'); + $c->forward('fetch_all_bodies'); + + return 1 unless $c->req->param('submit'); + + $c->forward('check_token'); + + my $user = $c->model('DB::User')->find_or_create( { + name => $c->req->param('name'), + email => $c->req->param('email'), + from_body => $c->req->param('body') || undef, + flagged => $c->req->param('flagged') || 0, + }, { + key => 'users_email_key' + } ); + $c->stash->{user} = $user; + + $c->forward( 'log_edit', [ $user->id, 'user', 'edit' ] ); + + $c->stash->{status_message} = + '<p><em>' . _('Updated!') . '</em></p>'; + + return 1; +} + sub user_edit : Path('user_edit') : Args(1) { my ( $self, $c, $id ) = @_; @@ -1295,7 +1325,11 @@ sub fetch_all_bodies : Private { my ($self, $c ) = @_; my @bodies = $c->model('DB::Body')->all; - @bodies = sort { strcoll($a->name, $b->name) } @bodies; + if ( $c->cobrand->moniker eq 'zurich' ) { + @bodies = $c->cobrand->admin_fetch_all_bodies( @bodies ); + } else { + @bodies = sort { strcoll($a->name, $b->name) } @bodies; + } $c->stash->{bodies} = \@bodies; return 1; diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 1c4718da7..81ace5a05 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -334,4 +334,43 @@ sub _admin_send_email { } ); } +sub admin_fetch_all_bodies { + my ( $self, @bodies ) = @_; + + sub tree_sort { + my ( $level, $id, $sorted, $out ) = @_; + + my @sorted; + my $array = $sorted->{$id}; + if ( $level == 0 ) { + @sorted = sort { + # Want Zurich itself at the top. + return -1 if $sorted->{$a->id}; + return 1 if $sorted->{$b->id}; + # Otherwise, by name + strcoll($a->name, $b->name) + } @$array; + } else { + @sorted = sort { strcoll($a->name, $b->name) } @$array; + } + foreach ( @sorted ) { + $_->api_key( $level ); # Misuse + push @$out, $_; + if ($sorted->{$_->id}) { + tree_sort( $level+1, $_->id, $sorted, $out ); + } + } + } + + my %sorted; + foreach (@bodies) { + my $p = $_->parent ? $_->parent->id : 0; + push @{$sorted{$p}}, $_; + } + + my @out; + tree_sort( 0, 0, \%sorted, \@out ); + return @out; +} + 1; diff --git a/perllib/FixMyStreet/Map/Zurich.pm b/perllib/FixMyStreet/Map/Zurich.pm index d2f7a35af..cec34f4fd 100644 --- a/perllib/FixMyStreet/Map/Zurich.pm +++ b/perllib/FixMyStreet/Map/Zurich.pm @@ -13,7 +13,7 @@ use Geo::Coordinates::CH1903; use Math::Trig; use Utils; -use constant ZOOM_LEVELS => 10; +use constant ZOOM_LEVELS => 9; use constant DEFAULT_ZOOM => 7; use constant MIN_ZOOM_LEVEL => 0; @@ -30,7 +30,7 @@ sub map_tiles { } sub base_tile_url { - return 'http://www.wmts.stadt-zuerich.ch/Luftbild/MapServer/WMTS/tile/1.0.0/Luftbild/default/nativeTileMatrixSet'; + return 'http://www.wmts.stadt-zuerich.ch/Hybrid/MapServer/WMTS/tile/1.0.0/Hybrid/default/nativeTileMatrixSet'; } sub copyright { @@ -90,10 +90,10 @@ sub latlon_to_tile($$$) { my ($x, $y) = Geo::Coordinates::CH1903::from_latlon($lat, $lon); - my $matrix_id = $zoom - 1; + my $matrix_id = $zoom; $matrix_id = 0 if $matrix_id < 0; - my @scales = ( '250000', '125000', '64000', '32000', '16000', '8000', '4000', '2000', '1000', '500' ); + my @scales = ( '250000', '125000', '64000', '32000', '16000', '8000', '4000', '2000', '1000' ); my $tileOrigin = { lat => 30814423, lon => -29386322 }; my $tileSize = 256; my $res = $scales[$zoom] / (39.3701 * 96); # OpenLayers.INCHES_PER_UNIT[units] * OpenLayers.DOTS_PER_INCH diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm index ca9e6f33e..d700dcb15 100644 --- a/perllib/FixMyStreet/SendReport/Zurich.pm +++ b/perllib/FixMyStreet/SendReport/Zurich.pm @@ -39,6 +39,9 @@ sub get_template { $template = 'submit-feedback-pending.txt'; } elsif ( $row->state eq 'closed' ) { $template = 'submit-external.txt'; + if ( $row->extra->{third_personal} ) { + $template = 'submit-external-personal.txt'; + } } my $template_path = FixMyStreet->path_to( "templates", "email", "zurich", $template )->stringify; diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 52d00f4b6..8963e417d 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -1061,7 +1061,7 @@ subtest 'report search' => sub { subtest 'search abuse' => sub { $mech->get_ok( '/admin/users?search=example' ); - $mech->content_like(qr/test4\@example.com.*\n.*\n.*Email in abuse table/); + $mech->content_like(qr{test4\@example.com.*</td>\s*<td>.*?</td>\s*<td>\(Email in abuse table}); }; subtest 'show flagged entries' => sub { diff --git a/templates/email/zurich/submit-external-personal.txt b/templates/email/zurich/submit-external-personal.txt new file mode 100644 index 000000000..949079d94 --- /dev/null +++ b/templates/email/zurich/submit-external-personal.txt @@ -0,0 +1,13 @@ +Subject: FixMyZurich: Neue Meldung #<?=$values['id']?> + +Guten Tag<?=$values['bodies_name']?>, + +Diese Meldung wurde Ihnen von der Stadt Zürich gesendet, da es Ihr Zuständigkeitsgebiet betreffen könnte. + +Öffentliche URL: <?=$values['url']?> + +Reporter name: <?=$values['name']?> + +Reporter email: <?=$values['email']?> + +Reporter phone: <?=$values['phone']?> diff --git a/templates/web/default/admin/bodies.html b/templates/web/default/admin/bodies.html index d6c706fce..ccd2e801b 100644 --- a/templates/web/default/admin/bodies.html +++ b/templates/web/default/admin/bodies.html @@ -2,14 +2,31 @@ [% INCLUDE 'admin/edit-league.html' %] +<table cellspacing="0" cellpadding="2" border="1"> + <tr> + <th>[% loc('Name') %]</th> + [% IF c.cobrand.moniker == 'zurich' %] + <th>[% loc('Email') %]</th> + [% ELSE %] + <th>[% loc('Category') %]</th> + [% END %] + </tr> [%- FOREACH body IN bodies %] [%- SET id = body.id %] - [%- '<ul>' IF loop.first %] [% NEXT IF c.cobrand.moniker == 'zurich' AND admin_type == 'dm' AND (body.parent OR body.bodies) %] - <li><a href="[% c.uri_for( 'body', id ) %]">[% body.name %]</a> - [%- ', ' _ body.parent.name IF body.parent -%] - [% IF c.cobrand.moniker != 'zurich' %] - – + <tr> + <td> + [% IF c.cobrand.moniker == 'zurich' %] + [% FILTER repeat(4*body.api_key) %] [% END %] + [% END %] + <a href="[% c.uri_for( 'body', id ) %]">[% body.name %]</a> + [% IF c.cobrand.moniker != 'zurich' %] + [%- ', ' _ body.parent.name IF body.parent -%] + [% END %] + </td> + [% IF c.cobrand.moniker == 'zurich' %] + <td>[% body.endpoint %]</td> + [% ELSE %] [% IF counts.$id %] [% tprintf( loc('%d addresses'), counts.$id.c) IF c.cobrand.moniker != 'emptyhomes' %] [% IF counts.$id.deleted %] @@ -21,8 +38,9 @@ no categories [% END %] [% END %] - [%- '</ul>' IF loop.last %] + </tr> [%- END %] +</table> <h2>[% loc('Add body') %]</h2> [% INCLUDE 'admin/body-form.html', body='' %] diff --git a/templates/web/default/admin/user-form.html b/templates/web/default/admin/user-form.html new file mode 100644 index 000000000..eec54d447 --- /dev/null +++ b/templates/web/default/admin/user-form.html @@ -0,0 +1,18 @@ +<form method="post" action="[% c.uri_for( 'user_edit', user.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <input type="hidden" name="token" value="[% token %]" > + <input type="hidden" name="submit" value="1" > + <ul> + <li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% user.name | html %]'></li> + <li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% user.email | html %]'></li> + <li>[% loc('Body:') %] <select id='body' name='body'> + <option value=''>[% loc('No body') %]</option> + [% FOR body IN bodies %] + <option value="[% body.id %]"[% ' selected' IF body.id == user.from_body.id %]>[% body.name %]</option> + [% END %] + </select> + [% IF c.cobrand.moniker != 'zurich' %] + <li>[% loc('Flagged:') %] <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]></li> + [% END %] + </ul> + <input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" > +</form> diff --git a/templates/web/default/admin/user_edit.html b/templates/web/default/admin/user_edit.html index df1cb221f..d69c873a3 100644 --- a/templates/web/default/admin/user_edit.html +++ b/templates/web/default/admin/user_edit.html @@ -3,20 +3,6 @@ [% status_message %] -<form method="post" action="[% c.uri_for( 'user_edit', user.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> - <input type="hidden" name="token" value="[% token %]" > - <input type="hidden" name="submit" value="1" > -<ul> -<li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% user.name | html %]'></li> -<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% user.email | html %]'></li> -<li>[% loc('Body:') %] <select id='body' name='body'> - <option value=''>[% loc('No body') %]</option> -[% FOR body IN bodies %] - <option value="[% body.id %]"[% ' selected' IF body.id == user.from_body.id %]>[% body.name %]</option> -[% END %] -</select> -<li>[% loc('Flagged:') %] <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]></li> -</ul> -<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form> +[% INCLUDE 'admin/user-form.html' %] [% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/users.html b/templates/web/default/admin/users.html index 7e652e559..de0b74746 100644 --- a/templates/web/default/admin/users.html +++ b/templates/web/default/admin/users.html @@ -2,17 +2,19 @@ [% PROCESS 'admin/report_blocks.html' %] <form method="get" action="[% c.uri_for('users') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> - <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search"> + <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search" value="[% searched | html %]"> </form> - [% IF searched %] + <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('Name') %]</th> <th>[% loc('Email') %]</th> <th>[% loc('Body') %]</th> + [% IF c.cobrand.moniker != 'zurich' %] <th>[% loc('Flagged') %]</th> + [% END %] <th>*</th> </tr> [%- FOREACH user IN users %] @@ -20,12 +22,19 @@ <td>[% PROCESS value_or_nbsp value=user.name %]</td> <td><a href="[% c.uri_for( 'reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td> <td>[% PROCESS value_or_nbsp value=user.from_body.name %]</td> + [% IF c.cobrand.moniker != 'zurich' %] <td>[% user.flagged == 2 ? loc('(Email in abuse table)') : user.flagged ? loc('Yes') : ' ' %]</td> + [% END %] <td>[% IF user.id %]<a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('Edit') %]</a>[% END %]</td> </tr> [%- END -%] </table> +[% ELSE %] + +<h2>[% loc('Add user') %]</h2> +[% INCLUDE 'admin/user-form.html' %] + [% END %] [% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/around/display_location.html b/templates/web/default/around/display_location.html index 85f89e130..c9586c393 100755 --- a/templates/web/default/around/display_location.html +++ b/templates/web/default/around/display_location.html @@ -52,6 +52,9 @@ [% map_html %] <p id='sub_map_links'> + [% IF c.cobrand.moniker == 'zurich' %] + <a class="hidden-nojs" id="map_layer_toggle" href="">Stadtplan</a> + [% END %] [% IF c.req.params.no_pins %] <a id='hide_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => 0 } ) %]'>[% loc('Show pins') %]</a> [% ELSE %] diff --git a/templates/web/default/report/new/category.html b/templates/web/default/report/new/category.html index 8bff539c4..f2ef529f2 100644 --- a/templates/web/default/report/new/category.html +++ b/templates/web/default/report/new/category.html @@ -7,7 +7,8 @@ <select name='category' id='form_category'[% ' onchange="form_category_onchange()"' IF category_extras.size %]> [% FOREACH cat_op IN category_options %] [% cat_op_lc = cat_op | lower %] - <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op || category == cat_op_lc %]>[% cat_op | html %]</option> + <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op || category == cat_op_lc -%] + >[% IF loop.first %][% cat_op %][% ELSE %][% cat_op | html %][% END %]</option> [% END %] </select> [% END %] diff --git a/templates/web/zurich/admin/body.html b/templates/web/zurich/admin/body.html index 143e61f83..dd1b0b844 100644 --- a/templates/web/zurich/admin/body.html +++ b/templates/web/zurich/admin/body.html @@ -1,4 +1,5 @@ [% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%] +[% PROCESS 'admin/report_blocks.html' %] [% IF updated %] <p> @@ -21,7 +22,7 @@ <td>[% contact.email | html %]</td> <td>[% contact.editor %]</td> <td>[% contact.note | html %]</td> - <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td> + <td>[% PROCESS format_date this_date=contact.whenedited %]</td> </tr> [% END %] </table> diff --git a/templates/web/zurich/admin/header.html b/templates/web/zurich/admin/header.html index 7e2337e6d..d0c399a83 100644 --- a/templates/web/zurich/admin/header.html +++ b/templates/web/zurich/admin/header.html @@ -22,18 +22,24 @@ select { width: auto; } <div class="admin-nav"> <ul> [% pagename = c.req.uri.path %] - [% pagename = pagename.replace('/admin/?(\w*)', '$1') %] + [% pagename = pagename.replace('/admin/?(\w*).*', '$1') %] <li [% IF pagename == 'summary' OR pagename == '' %]class="current"[% END %]> <a href="/admin/summary">[% loc('Summary') %]</a> </li> + <li [% IF pagename == 'reports' OR pagename == 'report_edit' %]class="current"[% END %]> + <a href="/admin/reports">[% loc('Reports') %]</a> + </li> [% IF admin_type == 'dm' OR admin_type == 'super' %] - <li [% IF pagename == 'bodies' %]class="current"[% END %]> + <li [% IF pagename == 'bodies' OR pagename == 'body' %]class="current"[% END %]> <a href="/admin/bodies">[% loc('Bodies') %]</a> </li> - <li [% IF pagename == 'reports' %]class="current"[% END %]> - <a href="/admin/reports">[% loc('Reports') %]</a> + [% END %] + [% IF admin_type == 'super' %] + <li [% IF pagename == 'users' OR pagename == 'user_edit' %]class="current"[% END %]> + <a href="/admin/users">[% loc('Users') %]</a> </li> + [% END %] <li class="search-box"> <form method="get" action="[% c.uri_for('reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> <input type="text" name="search" size="20" id="search" placeholder="[% loc('Search reports') %]"> @@ -43,9 +49,7 @@ select { width: auto; } </div> <!-- | <a href="timeline">Timeline</a> --> <!-- | <a href="questionnaire">Survey</a> --> - <!-- | <a href="/admin/users">[% loc('Users') %]</a> --> <!-- | <a href="flagged">Flagged</a> --> <!-- | <a href="stats">Stats</a> --> -[% END %] <h1 style="clear:both;">[% title %]</h1> diff --git a/templates/web/zurich/admin/reports.html b/templates/web/zurich/admin/reports.html index 0a3b5d568..f8c022630 100644 --- a/templates/web/zurich/admin/reports.html +++ b/templates/web/zurich/admin/reports.html @@ -1,14 +1,20 @@ [% PROCESS 'admin/header.html' title=loc('Search Reports') %] [% PROCESS 'admin/report_blocks.html' %] +<form method="get" action="[% c.uri_for('reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search" value="[% searched | html %]"> +</form> + + [% IF searched %] <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('ID') %]</th> - <th>[% loc('Title') %]</th> - <th>[% loc('State') %]</th> + <th>[% loc('Description') %]</th> <th>[% loc('Category') %]</th> - <th>[% loc('Created') %]</th> + <th>[% loc('Submitted') %]</th> + <th>[% loc('Updated') %]</th> + <th>[% loc('Status') %]</th> <th>*</th> </tr> [% INCLUDE 'admin/problem_row.html', page = 'search' %] diff --git a/templates/web/zurich/auth/sign_out.html b/templates/web/zurich/auth/sign_out.html new file mode 100644 index 000000000..fa2f6fd69 --- /dev/null +++ b/templates/web/zurich/auth/sign_out.html @@ -0,0 +1,8 @@ +[% INCLUDE 'header.html', title = loc('Sign out'), bodyclass = 'fullwidthpage' %] + +<h1>[% loc('You have been signed out') %]</h1> + +<p>Please feel free to <a href="[% c.uri_for('/admin') %]">sign in again</a>, or +go back to the <a href="/">front page</a>.</p> + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/zurich/footer.html b/templates/web/zurich/footer.html index f01e6671d..6b8ad004d 100644 --- a/templates/web/zurich/footer.html +++ b/templates/web/zurich/footer.html @@ -11,15 +11,6 @@ [% tprintf(loc('Hi %s'), c.user.name || c.user.email) %] </p><p><a href="/auth/sign_out">[% loc('sign out') %]</a> </p> - [% ELSE %] - <ul id="main-menu"> - <li><[% IF c.req.uri.path == '/' %]span[% ELSE %]a href="/"[% END %] - >[% loc("Report a problem") %]</[% c.req.uri.path == '/' ? 'span' : 'a' %]></li>[% - %]<li><[% IF c.req.uri.path == '/reports' %]span[% ELSE %]a href="/reports"[% END - %]>[% loc("All reports") %]</[% c.req.uri.path == '/reports' ? 'span' : 'a' %]></li>[% - %]<li><[% IF c.req.uri.path == '/faq' %]span[% ELSE %]a href="/faq"[% END - %]>[% loc("Help") %]</[% c.req.uri.path == '/faq' ? 'span' : 'a' %]></li> - </ul> [% END %] </div> </div> diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 65c738a8c..b9506c78a 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -10,14 +10,14 @@ * elem2: target element * offset: this will be added (if present) to the final value, useful for height errors */ -function heightFix(elem1, elem2, offset){ +function heightFix(elem1, elem2, offset, force) { var h1 = $(elem1).height(), h2 = $(elem2).height(); - if(offset === undefined){ + if (offset === undefined) { offset = 0; } - if(h1 > h2){ - $(elem2).css({'min-height':h1+offset}); + if (h1 > h2 || force) { + $(elem2).css( { 'min-height': h1+offset } ); } } @@ -437,7 +437,7 @@ $.fn.drawer = function(id, ajax) { if (cobrand == 'bromley') { offset = -110; } - heightFix(window, '.content', offset); + heightFix(window, '.content', offset, 1); // in case we have a map that isn't full screen map_fix(); } diff --git a/web/cobrands/zurich/zurich-wmts-hybrid.xml b/web/cobrands/zurich/zurich-wmts-hybrid.xml new file mode 100644 index 000000000..f1580cc89 --- /dev/null +++ b/web/cobrands/zurich/zurich-wmts-hybrid.xml @@ -0,0 +1,356 @@ +<?xml version="1.0" encoding="UTF-8"?>
+
+
+
+
+
+
+
+
+
+
+
+
+<Capabilities xmlns="http://www.opengis.net/wmts/1.0"
+ xmlns:ows="http://www.opengis.net/ows/1.1"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gml="http://www.opengis.net/gml"
+ xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd"
+ version="1.0.0">
+ <!-- Service Identification -->
+ <ows:ServiceIdentification>
+ <ows:Title>Hybrid</ows:Title>
+ <ows:ServiceType>OGC WMTS</ows:ServiceType>
+ <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
+</ows:ServiceIdentification> <!-- Operations Metadata --> <ows:OperationsMetadata>
+ <ows:Operation name="GetCapabilities">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Hybrid/MapServer/WMTS/1.0.0/WMTSCapabilities.xml">
+ <ows:Constraint name="GetEncoding">
+ <ows:AllowedValues>
+ <ows:Value>RESTful</ows:Value>
+ </ows:AllowedValues>
+ </ows:Constraint>
+ </ows:Get>
+ <!-- add KVP binding in 10.1 -->
+ <ows:Get xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Hybrid/MapServer/WMTS?">
+ <ows:Constraint name="GetEncoding">
+ <ows:AllowedValues>
+ <ows:Value>KVP</ows:Value>
+ </ows:AllowedValues>
+ </ows:Constraint>
+ </ows:Get>
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+ <ows:Operation name="GetTile">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Hybrid/MapServer/WMTS/tile/1.0.0/">
+ <ows:Constraint name="GetEncoding">
+ <ows:AllowedValues>
+ <ows:Value>RESTful</ows:Value>
+ </ows:AllowedValues>
+ </ows:Constraint>
+ </ows:Get>
+ <ows:Get xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Hybrid/MapServer/WMTS?">
+ <ows:Constraint name="GetEncoding">
+ <ows:AllowedValues>
+ <ows:Value>KVP</ows:Value>
+ </ows:AllowedValues>
+ </ows:Constraint>
+ </ows:Get>
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+</ows:OperationsMetadata>
+<Contents>
+ <!--Layer-->
+ <Layer>
+ <ows:Title>Hybrid</ows:Title>
+ <ows:Identifier>Hybrid</ows:Identifier>
+
+ <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::21781">
+ <ows:LowerCorner>665000.0 230000.0</ows:LowerCorner>
+ <ows:UpperCorner>700000.0 270000.0</ows:UpperCorner>
+ </ows:BoundingBox>
+
+ <ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
+ <ows:LowerCorner>8.297842338812158 47.21471096634782</ows:LowerCorner>
+ <ows:UpperCorner>8.768863108218179 47.57887356607757</ows:UpperCorner>
+ </ows:WGS84BoundingBox>
+ <Style isDefault="true">
+ <ows:Title>Default Style</ows:Title>
+ <ows:Identifier>default</ows:Identifier>
+ </Style>
+ <Format>image/jpgpng</Format>
+ <TileMatrixSetLink>
+ <TileMatrixSet>default028mm</TileMatrixSet>
+ </TileMatrixSetLink>
+ <TileMatrixSetLink>
+ <TileMatrixSet>nativeTileMatrixSet</TileMatrixSet>
+ </TileMatrixSetLink>
+
+ <ResourceURL format="image/jpgpng" resourceType="tile" template="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Hybrid/MapServer/WMTS/tile/1.0.0/Hybrid/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}" />
+ </Layer>
+ <!--TileMatrixSet-->
+ <TileMatrixSet>
+ <ows:Title>Default TileMatrix using 0.28mm</ows:Title>
+ <ows:Abstract>The tile matrix set that has scale values calculated based on the dpi defined by OGC specification (dpi assumes 0.28mm as the physical distance of a pixel).</ows:Abstract>
+ <ows:Identifier>default028mm</ows:Identifier>
+ <ows:SupportedCRS>urn:ogc:def:crs:EPSG::21781</ows:SupportedCRS>
+
+ <TileMatrix>
+ <ows:Identifier>0</ows:Identifier>
+ <ScaleDenominator>236235.11904761902</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>3</MatrixWidth>
+ <MatrixHeight>4</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>1</ows:Identifier>
+ <ScaleDenominator>118117.55952380951</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>5</MatrixWidth>
+ <MatrixHeight>6</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>2</ows:Identifier>
+ <ScaleDenominator>60476.19047619047</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>9</MatrixWidth>
+ <MatrixHeight>10</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>3</ows:Identifier>
+ <ScaleDenominator>30238.095238095237</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>17</MatrixWidth>
+ <MatrixHeight>19</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>4</ows:Identifier>
+ <ScaleDenominator>15119.047619047618</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>33</MatrixWidth>
+ <MatrixHeight>38</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>5</ows:Identifier>
+ <ScaleDenominator>7559.523809523809</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>66</MatrixWidth>
+ <MatrixHeight>75</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>6</ows:Identifier>
+ <ScaleDenominator>3779.7619047619046</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>131</MatrixWidth>
+ <MatrixHeight>149</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>7</ows:Identifier>
+ <ScaleDenominator>1889.8809523809523</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>260</MatrixWidth>
+ <MatrixHeight>296</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>8</ows:Identifier>
+ <ScaleDenominator>944.9404761904761</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>518</MatrixWidth>
+ <MatrixHeight>591</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>9</ows:Identifier>
+ <ScaleDenominator>472.4702380952381</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>1035</MatrixWidth>
+ <MatrixHeight>1182</MatrixHeight>
+
+ </TileMatrix>
+
+ </TileMatrixSet>
+ <TileMatrixSet>
+ <ows:Title>Native TiledMapService TileMatrixSet</ows:Title>
+ <ows:Abstract>the tile matrix set that has scale values calculated based on the dpi defined by ArcGIS Server tiled map service. The current tile dpi is 96</ows:Abstract>
+ <ows:Identifier>nativeTileMatrixSet</ows:Identifier>
+ <ows:SupportedCRS>urn:ogc:def:crs:EPSG::21781</ows:SupportedCRS>
+
+ <TileMatrix>
+ <ows:Identifier>0</ows:Identifier>
+ <ScaleDenominator>250000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>3</MatrixWidth>
+ <MatrixHeight>4</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>1</ows:Identifier>
+ <ScaleDenominator>125000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>5</MatrixWidth>
+ <MatrixHeight>6</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>2</ows:Identifier>
+ <ScaleDenominator>64000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>9</MatrixWidth>
+ <MatrixHeight>10</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>3</ows:Identifier>
+ <ScaleDenominator>32000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>17</MatrixWidth>
+ <MatrixHeight>19</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>4</ows:Identifier>
+ <ScaleDenominator>16000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>33</MatrixWidth>
+ <MatrixHeight>38</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>5</ows:Identifier>
+ <ScaleDenominator>8000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>66</MatrixWidth>
+ <MatrixHeight>75</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>6</ows:Identifier>
+ <ScaleDenominator>4000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>131</MatrixWidth>
+ <MatrixHeight>149</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>7</ows:Identifier>
+ <ScaleDenominator>2000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>260</MatrixWidth>
+ <MatrixHeight>296</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>8</ows:Identifier>
+ <ScaleDenominator>1000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>518</MatrixWidth>
+ <MatrixHeight>591</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>9</ows:Identifier>
+ <ScaleDenominator>500.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>1035</MatrixWidth>
+ <MatrixHeight>1182</MatrixHeight>
+
+ </TileMatrix>
+
+ </TileMatrixSet>
+
+</Contents>
+<ServiceMetadataURL xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Hybrid/MapServer/WMTS/1.0.0/WMTSCapabilities.xml" />
+</Capabilities>
diff --git a/web/cobrands/zurich/zurich-wmts-map.xml b/web/cobrands/zurich/zurich-wmts-map.xml new file mode 100644 index 000000000..b78f88826 --- /dev/null +++ b/web/cobrands/zurich/zurich-wmts-map.xml @@ -0,0 +1,356 @@ +<?xml version="1.0" encoding="UTF-8"?>
+
+
+
+
+
+
+
+
+
+
+
+
+<Capabilities xmlns="http://www.opengis.net/wmts/1.0"
+ xmlns:ows="http://www.opengis.net/ows/1.1"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:gml="http://www.opengis.net/gml"
+ xsi:schemaLocation="http://www.opengis.net/wmts/1.0 http://schemas.opengis.net/wmts/1.0/wmtsGetCapabilities_response.xsd"
+ version="1.0.0">
+ <!-- Service Identification -->
+ <ows:ServiceIdentification>
+ <ows:Title>Stadtplan</ows:Title>
+ <ows:ServiceType>OGC WMTS</ows:ServiceType>
+ <ows:ServiceTypeVersion>1.0.0</ows:ServiceTypeVersion>
+</ows:ServiceIdentification> <!-- Operations Metadata --> <ows:OperationsMetadata>
+ <ows:Operation name="GetCapabilities">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Stadtplan/MapServer/WMTS/1.0.0/WMTSCapabilities.xml">
+ <ows:Constraint name="GetEncoding">
+ <ows:AllowedValues>
+ <ows:Value>RESTful</ows:Value>
+ </ows:AllowedValues>
+ </ows:Constraint>
+ </ows:Get>
+ <!-- add KVP binding in 10.1 -->
+ <ows:Get xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Stadtplan/MapServer/WMTS?">
+ <ows:Constraint name="GetEncoding">
+ <ows:AllowedValues>
+ <ows:Value>KVP</ows:Value>
+ </ows:AllowedValues>
+ </ows:Constraint>
+ </ows:Get>
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+ <ows:Operation name="GetTile">
+ <ows:DCP>
+ <ows:HTTP>
+ <ows:Get xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Stadtplan/MapServer/WMTS/tile/1.0.0/">
+ <ows:Constraint name="GetEncoding">
+ <ows:AllowedValues>
+ <ows:Value>RESTful</ows:Value>
+ </ows:AllowedValues>
+ </ows:Constraint>
+ </ows:Get>
+ <ows:Get xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Stadtplan/MapServer/WMTS?">
+ <ows:Constraint name="GetEncoding">
+ <ows:AllowedValues>
+ <ows:Value>KVP</ows:Value>
+ </ows:AllowedValues>
+ </ows:Constraint>
+ </ows:Get>
+ </ows:HTTP>
+ </ows:DCP>
+ </ows:Operation>
+</ows:OperationsMetadata>
+<Contents>
+ <!--Layer-->
+ <Layer>
+ <ows:Title>Stadtplan</ows:Title>
+ <ows:Identifier>Stadtplan</ows:Identifier>
+
+ <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::21781">
+ <ows:LowerCorner>672499.0 238999.0</ows:LowerCorner>
+ <ows:UpperCorner>689999.0 256999.0</ows:UpperCorner>
+ </ows:BoundingBox>
+
+ <ows:WGS84BoundingBox crs="urn:ogc:def:crs:OGC:2:84">
+ <ows:LowerCorner>8.398302613481356 47.29709259053008</ows:LowerCorner>
+ <ows:UpperCorner>8.633312509540968 47.46115331797573</ows:UpperCorner>
+ </ows:WGS84BoundingBox>
+ <Style isDefault="true">
+ <ows:Title>Default Style</ows:Title>
+ <ows:Identifier>default</ows:Identifier>
+ </Style>
+ <Format>image/jpgpng</Format>
+ <TileMatrixSetLink>
+ <TileMatrixSet>default028mm</TileMatrixSet>
+ </TileMatrixSetLink>
+ <TileMatrixSetLink>
+ <TileMatrixSet>nativeTileMatrixSet</TileMatrixSet>
+ </TileMatrixSetLink>
+
+ <ResourceURL format="image/jpgpng" resourceType="tile" template="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Stadtplan/MapServer/WMTS/tile/1.0.0/Stadtplan/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}" />
+ </Layer>
+ <!--TileMatrixSet-->
+ <TileMatrixSet>
+ <ows:Title>Default TileMatrix using 0.28mm</ows:Title>
+ <ows:Abstract>The tile matrix set that has scale values calculated based on the dpi defined by OGC specification (dpi assumes 0.28mm as the physical distance of a pixel).</ows:Abstract>
+ <ows:Identifier>default028mm</ows:Identifier>
+ <ows:SupportedCRS>urn:ogc:def:crs:EPSG::21781</ows:SupportedCRS>
+
+ <TileMatrix>
+ <ows:Identifier>0</ows:Identifier>
+ <ScaleDenominator>236235.11904761902</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>2</MatrixWidth>
+ <MatrixHeight>2</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>1</ows:Identifier>
+ <ScaleDenominator>118117.55952380951</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>3</MatrixWidth>
+ <MatrixHeight>3</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>2</ows:Identifier>
+ <ScaleDenominator>60476.19047619047</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>5</MatrixWidth>
+ <MatrixHeight>5</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>3</ows:Identifier>
+ <ScaleDenominator>30238.095238095237</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>9</MatrixWidth>
+ <MatrixHeight>9</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>4</ows:Identifier>
+ <ScaleDenominator>15119.047619047618</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>17</MatrixWidth>
+ <MatrixHeight>18</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>5</ows:Identifier>
+ <ScaleDenominator>7559.523809523809</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>34</MatrixWidth>
+ <MatrixHeight>35</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>6</ows:Identifier>
+ <ScaleDenominator>3779.7619047619046</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>66</MatrixWidth>
+ <MatrixHeight>68</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>7</ows:Identifier>
+ <ScaleDenominator>1889.8809523809523</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>130</MatrixWidth>
+ <MatrixHeight>134</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>8</ows:Identifier>
+ <ScaleDenominator>944.9404761904761</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>259</MatrixWidth>
+ <MatrixHeight>267</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>9</ows:Identifier>
+ <ScaleDenominator>472.4702380952381</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>517</MatrixWidth>
+ <MatrixHeight>533</MatrixHeight>
+
+ </TileMatrix>
+
+ </TileMatrixSet>
+ <TileMatrixSet>
+ <ows:Title>Native TiledMapService TileMatrixSet</ows:Title>
+ <ows:Abstract>the tile matrix set that has scale values calculated based on the dpi defined by ArcGIS Server tiled map service. The current tile dpi is 96</ows:Abstract>
+ <ows:Identifier>nativeTileMatrixSet</ows:Identifier>
+ <ows:SupportedCRS>urn:ogc:def:crs:EPSG::21781</ows:SupportedCRS>
+
+ <TileMatrix>
+ <ows:Identifier>0</ows:Identifier>
+ <ScaleDenominator>250000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>2</MatrixWidth>
+ <MatrixHeight>2</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>1</ows:Identifier>
+ <ScaleDenominator>125000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>3</MatrixWidth>
+ <MatrixHeight>3</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>2</ows:Identifier>
+ <ScaleDenominator>64000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>5</MatrixWidth>
+ <MatrixHeight>5</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>3</ows:Identifier>
+ <ScaleDenominator>32000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>9</MatrixWidth>
+ <MatrixHeight>9</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>4</ows:Identifier>
+ <ScaleDenominator>16000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>17</MatrixWidth>
+ <MatrixHeight>18</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>5</ows:Identifier>
+ <ScaleDenominator>8000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>34</MatrixWidth>
+ <MatrixHeight>35</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>6</ows:Identifier>
+ <ScaleDenominator>4000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>66</MatrixWidth>
+ <MatrixHeight>68</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>7</ows:Identifier>
+ <ScaleDenominator>2000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>130</MatrixWidth>
+ <MatrixHeight>134</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>8</ows:Identifier>
+ <ScaleDenominator>1000.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>259</MatrixWidth>
+ <MatrixHeight>267</MatrixHeight>
+
+ </TileMatrix>
+
+ <TileMatrix>
+ <ows:Identifier>9</ows:Identifier>
+ <ScaleDenominator>500.0</ScaleDenominator>
+ <TopLeftCorner>-2.93864E7 3.08145E7</TopLeftCorner>
+ <TileWidth>256</TileWidth>
+ <TileHeight>256</TileHeight>
+
+ <MatrixWidth>517</MatrixWidth>
+ <MatrixHeight>533</MatrixHeight>
+
+ </TileMatrix>
+
+ </TileMatrixSet>
+
+</Contents>
+<ServiceMetadataURL xlink:href="http://www.wmts.stadt-zuerich.ch/arcgis/rest/services/Stadtplan/MapServer/WMTS/1.0.0/WMTSCapabilities.xml" />
+</Capabilities>
diff --git a/web/cobrands/zurich/Zurich-WMTSCapabilities.xml b/web/cobrands/zurich/zurich-wmts-satellite.xml index c8b863c22..c8b863c22 100644 --- a/web/cobrands/zurich/Zurich-WMTSCapabilities.xml +++ b/web/cobrands/zurich/zurich-wmts-satellite.xml diff --git a/web/js/OpenLayers.2.11.zurich.js b/web/js/OpenLayers.2.11.zurich.js index 671984fb4..62087500d 100644 --- a/web/js/OpenLayers.2.11.zurich.js +++ b/web/js/OpenLayers.2.11.zurich.js @@ -23,26 +23,6 @@ * *--------------------------------------------------------------------------*/ -/** -* -* Contains portions of Rico <http://openrico.org/> -* -* Copyright 2005 Sabre Airline Solutions -* -* Licensed under the Apache License, Version 2.0 (the "License"); you -* may not use this file except in compliance with the License. You -* may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -* implied. See the License for the specific language governing -* permissions and limitations under the License. -* -**/ - /** * Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/> * Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com) @@ -1381,4 +1361,4 @@ format(date.getMinutes())+':'+ format(date.getSeconds())+'"';}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(feature,pixel){},onDrag:function(feature,pixel){},onComplete:function(feature,pixel){},onEnter:function(feature){},onLeave:function(feature){},documentDrag:false,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(layer,options){OpenLayers.Control.prototype.initialize.apply(this,[options]);this.layer=layer;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks),{documentDrag:this.documentDrag}),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({click:this.clickFeature,clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})};},clickFeature:function(feature){if(this.handlers.feature.touch&&!this.over&&this.overFeature(feature)){this.handlers.drag.dragstart(this.handlers.feature.evt);this.handlers.drag.stopDown=false;}},clickoutFeature:function(feature){if(this.handlers.feature.touch&&this.over){this.outFeature(feature);this.handlers.drag.stopDown=true;}},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[]);},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments));},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=false;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments);},overFeature:function(feature){var activated=false;if(!this.handlers.drag.dragging){this.feature=feature;this.handlers.drag.activate();activated=true;this.over=true;OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over");this.onEnter(feature);}else{if(this.feature.id==feature.id){this.over=true;}else{this.over=false;}} return activated;},downFeature:function(pixel){this.lastPixel=pixel;this.onStart(this.feature,pixel);},moveFeature:function(pixel){var res=this.map.getResolution();this.feature.geometry.move(res*(pixel.x-this.lastPixel.x),res*(this.lastPixel.y-pixel.y));this.layer.drawFeature(this.feature);this.lastPixel=pixel;this.onDrag(this.feature,pixel);},upFeature:function(pixel){if(!this.over){this.handlers.drag.deactivate();}},doneDragging:function(pixel){this.onComplete(this.feature,pixel);},outFeature:function(feature){if(!this.handlers.drag.dragging){this.over=false;this.handlers.drag.deactivate();OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");this.onLeave(feature);this.feature=null;}else{if(this.feature.id==feature.id){this.over=false;}}},cancel:function(){this.handlers.drag.deactivate();this.over=false;},setMap:function(map){this.handlers.drag.setMap(map);this.handlers.feature.setMap(map);OpenLayers.Control.prototype.setMap.apply(this,arguments);},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.PinchZoom=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,containerOrigin:null,pinchOrigin:null,currentCenter:null,autoActivate:true,initialize:function(options){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Pinch(this,{start:this.pinchStart,move:this.pinchMove,done:this.pinchDone},this.handlerOptions);},activate:function(){var activated=OpenLayers.Control.prototype.activate.apply(this,arguments);if(activated){this.map.events.on({moveend:this.updateContainerOrigin,scope:this});this.updateContainerOrigin();} return activated;},deactivate:function(){var deactivated=OpenLayers.Control.prototype.deactivate.apply(this,arguments);if(this.map&&this.map.events){this.map.events.un({moveend:this.updateContainerOrigin,scope:this});} -return deactivated;},updateContainerOrigin:function(){var container=this.map.layerContainerDiv;this.containerOrigin={x:parseInt(container.style.left,10),y:parseInt(container.style.top,10)};},pinchStart:function(evt,pinchData){this.pinchOrigin=evt.xy;this.currentCenter=evt.xy;},pinchMove:function(evt,pinchData){var scale=pinchData.scale;var containerOrigin=this.containerOrigin;var pinchOrigin=this.pinchOrigin;var current=evt.xy;var dx=Math.round((current.x-pinchOrigin.x)+(scale-1)*(containerOrigin.x-pinchOrigin.x));var dy=Math.round((current.y-pinchOrigin.y)+(scale-1)*(containerOrigin.y-pinchOrigin.y));this.applyTransform("translate("+dx+"px, "+dy+"px) scale("+scale+")");this.currentCenter=current;},applyTransform:function(transform){var style=this.map.layerContainerDiv.style;style['-webkit-transform']=transform;style['-moz-transform']=transform;},pinchDone:function(evt,start,last){this.applyTransform("");var zoom=this.map.getZoomForResolution(this.map.getResolution()/last.scale,true);if(zoom!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){var resolution=this.map.getResolutionForZoom(zoom);var location=this.map.getLonLatFromPixel(this.pinchOrigin);var zoomPixel=this.currentCenter;var size=this.map.getSize();location.lon+=resolution*((size.w/2)-zoomPixel.x);location.lat-=resolution*((size.h/2)-zoomPixel.y);this.map.setCenter(location,zoom);}},CLASS_NAME:"OpenLayers.Control.PinchZoom"});
\ No newline at end of file +return deactivated;},updateContainerOrigin:function(){var container=this.map.layerContainerDiv;this.containerOrigin={x:parseInt(container.style.left,10),y:parseInt(container.style.top,10)};},pinchStart:function(evt,pinchData){this.pinchOrigin=evt.xy;this.currentCenter=evt.xy;},pinchMove:function(evt,pinchData){var scale=pinchData.scale;var containerOrigin=this.containerOrigin;var pinchOrigin=this.pinchOrigin;var current=evt.xy;var dx=Math.round((current.x-pinchOrigin.x)+(scale-1)*(containerOrigin.x-pinchOrigin.x));var dy=Math.round((current.y-pinchOrigin.y)+(scale-1)*(containerOrigin.y-pinchOrigin.y));this.applyTransform("translate("+dx+"px, "+dy+"px) scale("+scale+")");this.currentCenter=current;},applyTransform:function(transform){var style=this.map.layerContainerDiv.style;style['-webkit-transform']=transform;style['-moz-transform']=transform;},pinchDone:function(evt,start,last){this.applyTransform("");var zoom=this.map.getZoomForResolution(this.map.getResolution()/last.scale,true);if(zoom!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){var resolution=this.map.getResolutionForZoom(zoom);var location=this.map.getLonLatFromPixel(this.pinchOrigin);var zoomPixel=this.currentCenter;var size=this.map.getSize();location.lon+=resolution*((size.w/2)-zoomPixel.x);location.lat-=resolution*((size.h/2)-zoomPixel.y);this.map.setCenter(location,zoom);}},CLASS_NAME:"OpenLayers.Control.PinchZoom"}); diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index b76a7b166..cd77beefb 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -201,7 +201,8 @@ function fixmystreet_onload() { var showhide = [ 'Show pins', 'Hide pins', 'Dangos pinnau', 'Cuddio pinnau', - "Vis nåler", "Gjem nåler" + "Vis nåler", "Gjem nåler", + "Zeige Stecknadeln", "Stecknadeln ausblenden" ]; for (var i=0; i<showhide.length; i+=2) { if (this.innerHTML == showhide[i]) { @@ -267,19 +268,24 @@ $(function(){ } // Set it up our way - fixmystreet.layer_options = OpenLayers.Util.extend({ - zoomOffset: fixmystreet.zoomOffset, - transitionEffect: 'resize', - numZoomLevels: fixmystreet.numZoomLevels - }, fixmystreet.layer_options); var layer; - if (fixmystreet.layer_options.matrixIds) { - layer = new fixmystreet.map_type(fixmystreet.layer_options); - } else { - layer = new fixmystreet.map_type("", fixmystreet.layer_options); + if (!fixmystreet.layer_options.length) { + fixmystreet.layer_options = [ fixmystreet.layer_options ]; + } + for (var i=0; i<fixmystreet.layer_options.length; i++) { + fixmystreet.layer_options[i] = OpenLayers.Util.extend({ + zoomOffset: fixmystreet.zoomOffset, + transitionEffect: 'resize', + numZoomLevels: fixmystreet.numZoomLevels + }, fixmystreet.layer_options[i]); + if (fixmystreet.layer_options[i].matrixIds) { + layer = new fixmystreet.map_type(fixmystreet.layer_options[i]); + } else { + layer = new fixmystreet.map_type("", fixmystreet.layer_options); + } + fixmystreet.map.addLayer(layer); } - fixmystreet.map.addLayer(layer); if (!fixmystreet.map.getCenter()) { var centre = new OpenLayers.LonLat( fixmystreet.longitude, fixmystreet.latitude ); diff --git a/web/js/map-wmts-zurich.js b/web/js/map-wmts-zurich.js index 63f3f9cd7..12d267775 100644 --- a/web/js/map-wmts-zurich.js +++ b/web/js/map-wmts-zurich.js @@ -2,6 +2,16 @@ * Maps for FMZ using Zurich council's WMTS tile server */ +$(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]); + }); +}); + /* * set_map_config() is called on dom ready in map-OpenLayers.js * to setup the way the map should operate. @@ -35,16 +45,16 @@ fixmystreet.map_options = { maxExtent: new OpenLayers.Bounds(676000, 241000, 690000, 255000), units: 'm', - scales: [ '250000', '125000', '64000', '32000', '16000', '8000', '4000', '2000', '1000', '500'] + scales: [ '250000', '125000', '64000', '32000', '16000', '8000', '4000', '2000', '1000' ] }; - fixmystreet.layer_options = { + var layer_options = { projection: new OpenLayers.Projection("EPSG:21781"), - name: "Luftbild", - layer: "Luftbild", + name: "Hybrid", + layer: "Hybrid", matrixSet: "nativeTileMatrixSet", requestEncoding: "REST", - url: "http://www.wmts.stadt-zuerich.ch/Luftbild/MapServer/WMTS/tile/", + url: "http://www.wmts.stadt-zuerich.ch/Hybrid/MapServer/WMTS/tile/", style: "default", matrixIds: [ { identifier: "0", matrixHeight: 2, matrixWidth: 2, scaleDenominator: 250000, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } }, @@ -59,6 +69,13 @@ { identifier: "9", matrixHeight: 415, matrixWidth: 414, scaleDenominator: 500, supportedCRS: "urn:ogc:def:crs:EPSG::21781", tileHeight: 256, tileWidth: 256, topLeftCorner: { lat: 30814423, lon: -29386322 } } ] }; + fixmystreet.layer_options = [ + layer_options, OpenLayers.Util.applyDefaults({ + name: "Stadtplan", + layer: "Stadtplan", + url: "http://www.wmts.stadt-zuerich.ch/Stadtplan/MapServer/WMTS/tile/" + }, layer_options) + ]; // Give main code a new bbox_strategy that translates between // lat/lon and our swiss coordinates |