PHP Classes

All gray in map output

Recommend this page to a friend!

      PHP Classes blog  >  Using PHP MySQL with ...  >  All threads  >  All gray in map output  >  (Un) Subscribe thread alerts  
Subject:All gray in map output
Summary:I'm getting all gray in the map output div
Messages:4
Author:Clyde Cupple
Date:2015-08-11 23:16:21
Update:2015-08-14 19:04:27
 

  1. All gray in map output   Reply   Report abuse  
Picture of Clyde Cupple Clyde Cupple - 2015-08-12 00:49:09
Hello Ashraf,

Thank you for the class. I'm having a problem with the map showing up. All get is a gray box where the map should be. I checked one of your completed versions and I'm having the same issue. I tried the version in explorer, chrome, and firefox.

Look forward to your feedback and thanks again!

Clyde

  2. Re: All gray in map output   Reply   Report abuse  
Picture of Ashraf Gheith Ashraf Gheith - 2015-08-12 18:01:49 - In reply to message 1 from Clyde Cupple
Hi Clyde,
can you post your code to see it please?

  3. Re: All gray in map output   Reply   Report abuse  
Picture of Clyde Cupple Clyde Cupple - 2015-08-12 21:28:51 - In reply to message 2 from Ashraf Gheith
Hello Ashraf,

The code is below. It is from the first php file you had us put together. It is the index.php. I'm new to this so I wanted to make sure I was not missing something. I thought there was a chance that the layers had not been added but wanted to make sure. Look forward to your thoughts.

!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Leaflet basic example</title>
<link rel="stylesheet" href="css/leaflet.css"/>
<script src="js/leaflet.js"></script>
</head>
<body>
<div id="map" style="width: 600px; height: 400px"></div>
<script>
var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer( 'https://' + '{s}.tiles.mapbox.com/' + 'v3/{id}/{z}/{x}/{y}.png', {maxZoom: 18, attribution: 'Map data &copy; <a href="http://openstreetmap.org/"> OpenStreetMap </a> contributors, ' + '<a href="http://creativecommons.org/"> CC-BY-SA </a>, ' + 'Imagery (c) <a href="http://mapbox.com"> Mapbox </a>', id: 'examples.map-i875mjb7'}).addTo(map);
</script>

</body>
</html>

Thanks again!

  4. Re: All gray in map output   Reply   Report abuse  
Picture of Ashraf Gheith Ashraf Gheith - 2015-08-14 19:04:27 - In reply to message 3 from Clyde Cupple
Check the doctype declaration. Then check if leaflet is in the right path. And create you own free account in mapbox, I think mapbox deleted my account for inactivity.