<commit_before>#!/usr/bin/perl
#
# FixMyStreet:Map::FMS
# Bing and OS StreetView maps on FixMyStreet, using OpenLayers.
#
# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved.
# Email: <EMAIL>; WWW: http://www.mysociety.org/

package FixMyStreet::Map::FMS;
use base 'FixMyStreet::Map::OSM';

use strict;

# Is set by the JavaScript
sub map_type {
    return '""';
}

sub map_template {
    return 'fms';
}

sub copyright {
    return _('Map contains Ordnance Survey data &copy; Crown copyright and database right 2010.<br>&copy; 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. &copy; AND, Navteq, Ordnance Survey.');
}

sub get_quadkey {
    my ($x, $y, $z) = @_;
    my $key = '';
    for (my $i = $z; $i > 0; $i--) {
        my $digit = 0;
        my $mask = 1 << ($i - 1);
        $digit++ if ($x & $mask) != 0;
        $digit += 2 if ($y & $mask) != 0;
        $key .= $digit;
    }
    return $key;
}

sub map_tiles {
    my ($self, $x, $y, $z) = @_;
    if ($z >= 16) {
        return [
            "http://a.os.openstreetmap.org/sv/$z/" . ($x-1) . "/" . ($y-1) . ".png",
            "http://b.os.openstreetmap.org/sv/$z/$x/" . ($y-1) . ".png",
            "http://c.os.openstreetmap.org/sv/$z/" . ($x-1) . "/$y.png",
            "http://os.openstreetmap.org/sv/$z/$x/$y.png",
        ];
    } else {
        return [
            "http://ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?g=587&productSet=mmOS",
            "http://ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x,   $y-1, $z) . ".png?g=587&productSet=mmOS",
            "http://ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y,   $z) . ".png?g=587&productSet=mmOS",
            "http://ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x,   $y,   $z) . ".png?g=587&productSet=mmOS",
        ];
    }
}

1;
<commit_msg>Non-JS using the right tile server.<commit_after>#!/usr/bin/perl
#
# FixMyStreet:Map::FMS
# Bing and OS StreetView maps on FixMyStreet, using OpenLayers.
#
# Copyright (c) 2011 UK Citizens Online Democracy. All rights reserved.
# Email: <EMAIL>; WWW: http://www.mysociety.org/

package FixMyStreet::Map::FMS;
use base 'FixMyStreet::Map::OSM';

use strict;

# Is set by the JavaScript
sub map_type {
    return '""';
}

sub map_template {
    return 'fms';
}

sub copyright {
    return _('Map contains Ordnance Survey data &copy; Crown copyright and database right 2010.<br>&copy; 2011 <a href="http://www.bing.com/maps/">Microsoft</a>. &copy; AND, Navteq, Ordnance Survey.');
}

sub get_quadkey {
    my ($x, $y, $z) = @_;
    my $key = '';
    for (my $i = $z; $i > 0; $i--) {
        my $digit = 0;
        my $mask = 1 << ($i - 1);
        $digit++ if ($x & $mask) != 0;
        $digit += 2 if ($y & $mask) != 0;
        $key .= $digit;
    }
    return $key;
}

sub map_tiles {
    my ($self, $x, $y, $z) = @_;
    if ($z >= 16) {
        return [
            "http://a.tilma.mysociety.org/sv/$z/" . ($x-1) . "/" . ($y-1) . ".png",
            "http://b.tilma.mysociety.org/sv/$z/$x/" . ($y-1) . ".png",
            "http://c.tilma.mysociety.org/sv/$z/" . ($x-1) . "/$y.png",
            "http://tilma.mysociety.org/sv/$z/$x/$y.png",
        ];
    } else {
        return [
            "http://ecn.t0.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y-1, $z) . ".png?g=587&productSet=mmOS",
            "http://ecn.t1.tiles.virtualearth.net/tiles/r" . get_quadkey($x,   $y-1, $z) . ".png?g=587&productSet=mmOS",
            "http://ecn.t2.tiles.virtualearth.net/tiles/r" . get_quadkey($x-1, $y,   $z) . ".png?g=587&productSet=mmOS",
            "http://ecn.t3.tiles.virtualearth.net/tiles/r" . get_quadkey($x,   $y,   $z) . ".png?g=587&productSet=mmOS",
        ];
    }
}

1;

{'fraction_non_alphanumeric': 0.21778487752928646, 'fraction_numerical': 0.024494142705005325, 'mean_word_length': 2.2726480836236935, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2737822', 'n_tokens_mistral': 1616, 'n_tokens_neox': 1503, 'n_words': 305}