2

I have a CartoDB map that is using PHP to connect to my CartoDB account and show layers. I am having people report that they can see the map, but not the layers and I am not sure why... below is an image of the error showing up in Chrome, but only for certain users.

Image of the error in Chrome

I tried setting up .htaccess to allow cross origin requests like so:

    <FilesMatch "\.(js)$">
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Origin http://www.example.com 
    Header set Access-Control-Allow-Origin http://example.com 
    Header set Access-Control-Allow-Origin http://projectname.example.com
    Header set Access-Control-Allow-Credentials true
    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>
</FilesMatch>

I have also tried setting my php files to include the allow access origin: PHP File 1:

<?php
    header("Access-Control-Allow-Origin: *");
include 'http://example.com/phplocation/cartodbProxy.php';
$queryURL = $_POST['qurl'];
$return = goProxy($queryURL);
echo $return;
?>

PHP File 2:

<?php
header("Access-Control-Allow-Origin: *");
session_cache_limiter('nocache');
$cache_limiter = session_cache_limiter();
function goProxy($dataURL) 
{
    $baseURL = 'https://cartoDBUserName.cartodb.com/phplocation/v2/sql?';
    $api = '&api_key=enter API key here';
    $url = $baseURL.'q='.urlencode($dataURL).$api;
    $result = file_get_contents ($url);
    return $result;
}
?>

I also tried:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/projectLocation/$1 [L,R=301]

Still users cannot access....

dchadney
  • 283
  • 2
  • 7
  • 18
  • Solved - turned out to not be the issue - was an issue with CartoDB and the way it imported a shapefile. – dchadney Jul 21 '15 at 14:46

0 Answers0