source: trunk/tools/gmaps/server.php @ 159

Revision 159, 610 bytes checked in by cirrus, 6 years ago (diff)

Added: Custom maps support. Ability to enable/disable map types (e.g. satellite, hybrid, etc.). Closes #100
Bugfix: Fixed foreach array error. Closes #98
Change: Gearth now uses title_small for the filename.
Change: Gearth default zoom location now calculated from the config file min/max lon/lat options.
Change: Suggest search minor javascript change.

Line 
1<?php
2//Images go to the maptiles directory in the format x_y_z.jpg
3
4           define("NO_DATA", "./maptiles/no_data.jpg");
5     
6           $x = $_GET["x"];
7           $y = $_GET["y"];
8           $z = $_GET["zoom"];
9           $filename = "./maptiles/${x}_${y}_${z}.jpg";
10     
11           if (is_numeric($x) && is_numeric($y) && is_numeric($z) && file_exists($filename)){
12                 $content = file_get_contents( $filename );
13           }else{
14                 $content = file_get_contents( NO_DATA );
15           }
16     
17           header("Content-type: image/jpg");
18     
19           echo $content;
20?>
Note: See TracBrowser for help on using the repository browser.