3

I am trying to set up a tile map service on Apache. I tried following this: Setting Up a TMS Tile Map Service on a Web Server but when I go to load the page it's not loading the images in my /var/www/TMS/1.0.0/ne1 directory returning "Failed to load resource: the server responded with a status of 404 (Not Found) http://mysite-name.com/TMS/1.0.0/ne1/2/0/1.png" in the error console.

In the Apache config file:

Alias /map/ "/var/www/TMS/1.0.0/ne1/openlayers.html"
<Directory /var/www/TMS>
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order Allow,Deny
    Allow from all
</Directory>

root.xml file:

<?xml version="1.0" ?>

<Services>

  <TileMapService title=" Tile Map Service" version="1.0.0" href="http://mysite-name.com/TMS/1.0.0/service.xml" />

</Services>

service.xml file:

<?xml version="1.0"?>

<TileMapService version="1.0.0" services="http://mysite-name.com/TMS/root.xml">

<TileMaps>

   <TileMap srs="EPSG:4326" title="ne1" profile="geodetic" href="http://mysite-name.com/TMS/1.0.0/ne1/tilemapresource.xml"/>

</TileMaps>

</TileMapService>

tilemapresource.xml:

<?xml version="1.0" encoding="utf-8"?>
    <TileMap version="1.0.0" tilemapservice="http://mysite-name.com/TMS/1.0.0/service.xml">
      <Title>test.vrt</Title>
      <Abstract></Abstract>
      <SRS>EPSG:4326</SRS>
      <BoundingBox minx="-125.00000000000000" miny="20.00330020777438" maxx="-54.99858571732217" maxy="50.00000000000000"/>
      <Origin x="-125.00000000000000" y="20.00330020777438"/>
      <TileFormat width="256" height="256" mime-type="image/png" extension="png"/>
      <TileSets profile="geodetic">
        <TileSet href="2" units-per-pixel="0.17578125000000" order="2"/>
        <TileSet href="3" units-per-pixel="0.08789062500000" order="3"/>
        <TileSet href="4" units-per-pixel="0.04394531250000" order="4"/>
        <TileSet href="5" units-per-pixel="0.02197265625000" order="5"/>
        <TileSet href="6" units-per-pixel="0.01098632812500" order="6"/>
        <TileSet href="7" units-per-pixel="0.00549316406250" order="7"/>
        <TileSet href="8" units-per-pixel="0.00274658203125" order="8"/>
      </TileSets>
    </TileMap>

openlayers.html:

var layer = new OpenLayers.Layer.TMS("Weather TMS","http://mysite-name.com/TMS/",
                    {
                         layername: "ne1",
                         type: "png",
                         isBaseLayer: true,
                         getURL:getURL
                    });
                   map.addLayers([layer]);

If there are no suggestions to fix this problem, could you point me to something similar to Tile Map Service. I am using gdal2tiles to break up my images into tiles and I have many images that I would like to serve through a tile service.

1

I had my configuration messed up

Apache config:

Alias /map/ "/var/www/TMS/"
<Directory "/var/www/TMS">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order Allow,Deny
    Allow from all
</Directory>

In open layers.html, I was using http://mysite-name.com/TMS/ (the directory) when I should have been using the alias (map) in the Apache configuration file:

 var layer = new OpenLayers.Layer.TMS("Weather TMS","http://mysite-name.com/map/",
                    {
                         layername: "ne1",
                         type: "png",
                         isBaseLayer: true,
                         getURL:getURL
                    });
                   map.addLayers([layer]);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.