I did have verify state of my OSM tile server by using webrowser. For example at http://localhost/osm_tiles/0/0/0.png I get small picture od world. Evertthing seems to be working at server side to me.
Cesium connected to online source of maps works fine as well.
Problem pops up, when i try connect Cesium to local OSM server.
In Firefox console I get this error:
"An error occurred in "": Failed to obtain image tile X: 1 Y: 1 Level: 1." Cesium.js:381:25514
"An error occurred in "": Failed to obtain image tile X: 1 Y: 0 Level: 1." Cesium.js:381:25514
"An error occurred in "": Failed to obtain image tile X: 0 Y: 0 Level: 1." Cesium.js:381:25514
"An error occurred in "": Failed to obtain image tile X: 0 Y: 1 Level: 1." Cesium.js:381:25514I'm already stuck with this problem for quite a few days. Here is what I have tried and found out so far:
My DEFAULT_ERRORLOG is set to "logs/error_log",
but there is no such file on my system. With documentation on apache.org
i was able locate /var/log/apache2/error.log file.
Per request a
identical line pops up in there :
debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile I was not able to achieve this. Cesium does not like that. Spits at me angrily this:
Error: Port 8080 is already in use, select a different port.
Example: node server.js --port 8081
{ [Error: listen EADDRINUSE] code: 'EADDRINUSE', errno: 'EADDRINUSE', syscall: 'listen' } I achieved this by changing port numbers from 80 to 8080 in files /etc/apache2/ports.conf and /etc/apache2/sites-enabled/000-default.conf .
Maybe I screwed up somewhere in the proces. Here is what I did:
Enabled mod_headers in Apache by
a2enmod headers
Changing Apache configuration file /etc/apache2/apache.conf by adding line
Header set Access-Control-Allow-Origin "*"
Did not forget obligatory reloading server by
sudo service apache2 reload
Pretty please: Do anyone have idea what am I doing wrong?
Here is sourcecode of webpage I'm running Cesium from:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Use correct character set. -->
<meta charset="utf-8">
<!-- Tell IE to use the latest, best version (or Chrome Frame if pre-IE11). -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>Hello World!</title>
<script src="../Build/Cesium/Cesium.js"></script>
<style>
@import url(../Build/Cesium/Widgets/widgets.css);
html, body, #cesiumContainer {
width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
//Initialize the viewer widget with several custom options and mixins.
var viewer = new Cesium.Viewer('cesiumContainer', {
//Hide the base layer picker
baseLayerPicker : false,
//Use OpenStreetMaps
imageryProvider : new Cesium.OpenStreetMapImageryProvider({
url : 'http://localhost/osm_tiles/'
//url : '//a.tile.openstreetmap.org/'
}),
// Show Columbus View map with Web Mercator projection
// mapProjection : new Cesium.WebMercatorProjection()
});
//Add basic drag and drop functionality
viewer.extend(Cesium.viewerDragDropMixin);
//Show a pop-up alert if we encounter an error when processing a dropped file
viewer.dropError.addEventListener(function(dropHandler, name, error) {
console.log(error);
window.alert(error);
});
</script>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
* Hostname was NOT found in DNS cache
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /osm_tiles/0/0/0.png HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Fri, 13 Mar 2015 15:10:19 GMT
* Server Apache/2.4.7 (Ubuntu) is not blacklisted
< Server: Apache/2.4.7 (Ubuntu)
< ETag: "337ab9a3fb2a307a148786460b7b973b"
< Content-Length: 7898
< Cache-Control: max-age=1258
< Expires: Fri, 13 Mar 2015 15:31:17 GMT
< Content-Type: image/png
<
{ [data not shown]
100 7898 100 7898 0 0 1274k 0 --:--:-- --:--:-- --:--:-- 1542k
* Connection #0 to host localhost left intact
<Directory /var/lib/mod_tile/>
#CORS settings: to allow Cesium get maptiles from mod_tile & renderd Apache plugins
Header set Access-Control-Allow-Origin "*"
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>