bmcbride / PHP-MBTiles-Server

PHP MBTiles Server
90 stars 33 forks source link

clean URL with .htaccess RewriteEngine #4

Open kampar opened 4 years ago

kampar commented 4 years ago
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# db, z x y .png
RewriteRule  tile/(.*)/(.*)/(.*)/(.*)\.jpg$ "mbtiles.php?db=$1&z=$2&x=$3&y=$4" [L]
RewriteRule  tile/(.*)/(.*)/(.*)/(.*)\.png$ "mbtiles.php?db=$1&z=$2&x=$3&y=$4" [L]
kampar commented 4 years ago

POC

//var mbTiles = new L.tileLayer('mbtiles.php?db=ArcGISImagery_0sd6&z={z}&x={x}&y={y}', {
var mbTiles = new L.tileLayer('tile/ArcGISImagery_0sd6/{z}/{x}/{y}.jpg', {
        minZoom:0,
        maxZoom:6,
            tms: true//, // TMS terbalik y nya
});

cleaner JavaScript URL ...