Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config info #1

Open
schierkolk opened this issue Mar 14, 2023 · 9 comments
Open

config info #1

schierkolk opened this issue Mar 14, 2023 · 9 comments

Comments

@schierkolk
Copy link

What configuration file do I update and where in the file do I update?

@systemed
Copy link
Owner

Whatever the Apache config file is for the virtual host (site) you're deploying. For example, /etc/apache2/sites-available/my.tile.server.com.conf.

You would typically put the directives within the <Directory> unit of that file.

@schierkolk
Copy link
Author

Thank you for getting back to me. I am not getting any data to come through nor am I getting any errors. Would it be possible to get am example .conf to make sure I am doing this correctly?

@systemed
Copy link
Owner

Mine looks like this (with paths/domains obfuscated):

<VirtualHost *:80>
    DocumentRoot "/srv/tile.my.server"

    ServerName tile.my.server

    <Directory "/srv/tile.my.server">
        allow from all
        Options None
        Require all granted

        Header set Access-Control-Allow-Origin "*"
        
        MbtilesEnabled true
        MbtilesAdd dem /data/relief/dem.mbtiles
        MbtilesAdd contours /data/relief/contours.mbtiles
        MbtilesAdd vt /data/vector_tiles/vt.mbtiles
    </Directory>
</VirtualHost>

Most of this is just standard Apache. Only the four Mbtiles lines are new.

Don't forget you need to restart Apache once you've changed a config file.

@resiliencetheatre
Copy link

Can you provide reference how you use vt/ in your web page to display map?

@systemed
Copy link
Owner

Using the Maplibre GL JS library.

@resiliencetheatre
Copy link

Yes, I use same - but have hard time understanding how you define layers from mod_mbtiles ? Example would be great!

@systemed
Copy link
Owner

Not quite sure what you mean? You don't define any layers in mod_mbtiles - it simply serves out the .mbtiles file (containing vector tiles) that you point it at. Layers are defined when you create the vector tiles with other software, such as tilemaker.

@resiliencetheatre
Copy link

resiliencetheatre commented May 14, 2023

This is how I've defined my tileserver-gl provided mbtiles for my style.json:

"sources": {
"openmaptiles": {
"type": "vector",
"url": "http://localhost:8080/data/v3.json"
}
},

But somehow I am not able to get mod_mbtiles URL here to provide anything useful?

@systemed
Copy link
Owner

mod_mbtiles just serves vector tiles from an mbtiles. Nothing else. It doesn't generate or serve tilejson documents or anything like that.

You either need to specify the location of your Apache virtual server (running mod_mbtiles) in the .json file you're pointing to above, or just put it in directly:

  "sources":{
    "openmaptiles":{
      "type":"vector",
      "tiles":["https://my.tile.server/directory/{z}/{x}/{y}.pbf"],
      "minzoom":0,
      "maxzoom":14,
      "attribution":"Base map © OpenStreetMap"
    }
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants