From 6eed8dda87ae48559d5275f4a98e8f1508e57467 Mon Sep 17 00:00:00 2001
From: Pol Dell'Aiera <Pol@47194.no-reply.drupal.org>
Date: Thu, 17 Jan 2013 20:37:49 +0100
Subject: [PATCH] Issue 1791478: Fix for OpenLayers module.

---
 includes/layer_types/mapbox.inc |    6 +++---
 includes/mapbox.layers.inc      |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/includes/layer_types/mapbox.inc b/includes/layer_types/mapbox.inc
index b6b9afc..1c504ae 100644
--- a/includes/layer_types/mapbox.inc
+++ b/includes/layer_types/mapbox.inc
@@ -10,12 +10,12 @@ class openlayers_layer_type_mapbox extends openlayers_layer_type {
    */
   function options_init() {
     return array(
-      'urls' => array(
+      'urls' => implode("\n", array(
         'http://a.tiles.mapbox.com/mapbox/',
         'http://b.tiles.mapbox.com/mapbox/',
         'http://c.tiles.mapbox.com/mapbox/',
         'http://d.tiles.mapbox.com/mapbox/',
-      ),
+      )),
       'serverResolutions' => openlayers_get_resolutions('900913'),
       'maxExtent' => openlayers_get_extent('900913'),
       'projection' => array('900913'),
@@ -42,7 +42,7 @@ class openlayers_layer_type_mapbox extends openlayers_layer_type {
           '!tiles' => l(t('TileStream'), 'http://tiles.mapbox.com/'),
           '!support' => l(t('MapBox Support'), 'http://support.mapbox.com/kb/tilestream/using-tilestream-with-drupal'),
         )),
-        '#default_value' => !empty($this->data['urls']) ? implode("\n", $this->data['urls']) : '',
+        '#default_value' => !empty($this->data['urls']) ? $this->data['urls'] : '',
       ),
       'layername' => array(
         '#type' => 'textfield',
diff --git a/includes/mapbox.layers.inc b/includes/mapbox.layers.inc
index edff5db..be19c3a 100644
--- a/includes/mapbox.layers.inc
+++ b/includes/mapbox.layers.inc
@@ -72,12 +72,12 @@ function _mapbox_openlayers_layers() {
     $openlayers_layers->title = $item['name'];
     $openlayers_layers->description = $item['description'];
     $openlayers_layers->data = array(
-      'urls' => array(
+      'urls' => implode("\n", array(
         0 => 'http://a.tiles.mapbox.com/mapbox/',
         1 => 'http://b.tiles.mapbox.com/mapbox/',
         2 => 'http://c.tiles.mapbox.com/mapbox/',
         3 => 'http://d.tiles.mapbox.com/mapbox/',
-      ),
+      )),
       'layername' => $item['layername'],
       'layer_type' => 'openlayers_layer_type_mapbox',
       'osm' => FALSE,
-- 
1.7.3.4

