You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
550 B

  1. <?php
  2. use \Slim\Savant;
  3. $app->get('/', function() use($app) {
  4. return Savant\render('index');
  5. });
  6. $app->get('/static-maps', function() use($app) {
  7. return Savant\render('static-maps');
  8. });
  9. $app->get('/map', function() use($app) {
  10. return Savant\render('map');
  11. });
  12. $app->map('/map/img', function() use($app) {
  13. $params = $app->request()->params();
  14. $app->response['Content-type'] = 'image/png';
  15. $assetPath = dirname(__FILE__) . '/../public/map-images';
  16. $map = p3k\geo\StaticMap\generate($params, null, $assetPath);
  17. })->via('GET','POST');