Permalink
Browse files

separated file for MapQuest

  • Loading branch information...
1 parent d358f7d commit 192501e0116160e81f5166a5cbce164493dc8883 Guillaume committed Mar 20, 2012
Showing with 33 additions and 0 deletions.
  1. +33 −0 perllib/FixMyStreet/Map/OSM/MapQuest.pm
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+#
+# FixMyStreet:Map::OSM::CycleMap
+# OSM CycleMap maps on FixMyStreet.
+#
+# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
+# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
+
+package FixMyStreet::Map::OSM::MapQuest;
+use base 'FixMyStreet::Map::OSM';
+
+use strict;
+
+sub map_type {
+ return 'OpenLayers.Layer.OSM.MapQuestOpen';
+}
+
+sub map_tiles {
+ my ($self, $x, $y, $z) = @_;
+ my $tile_url = $self->base_tile_url();
+ return [
+ "http://otile1.$tile_url/$z/" . ($x - 1) . "/" . ($y - 1) . ".png",
+ "http://otile2.$tile_url/$z/$x/" . ($y - 1) . ".png",
+ "http://otile3.$tile_url/$z/" . ($x - 1) . "/$y.png",
+ "http://otile4.$tile_url/$z/$x/$y.png",
+ ];
+}
+
+sub base_tile_url {
+ return 'mqcdn.com/tiles/1.0.0/osm/';
+}
+
+1;

0 comments on commit 192501e

Please sign in to comment.