Skip to content

Instantly share code, notes, and snippets.

View Zverik's full-sized avatar

Ilya Zverev Zverik

View GitHub Profile
@Zverik
Zverik / SingleTile.js
Last active July 4, 2018 12:41
A layer for single-tile WMS layers. Displays a layer as a big picture, updates it on pan and zoom. This is a hack, made for an internal project; still waiting for https://github.com/Leaflet/Leaflet/issues/558 to be solved nicely. Example: L.singleTile('http://irs.gis-lab.info/').setParams({layers: 'landsat'}).addTo(map); (won't work, because tha…
/*
* L.SingleTile uses L.ImageOverlay to display a single-tile WMS layer.
* url parameter must accept WMS-style width, height and bbox.
*/
L.SingleTile = L.ImageOverlay.extend({
defaultWmsParams: {
service: 'WMS',
request: 'GetMap',
version: '1.1.1',
@Zverik
Zverik / recursive_index.pl
Created August 31, 2012 16:14
Create index.html with a list of all files
#!/usr/bin/perl
# Create index.html with a list of all files.
# Written by Ilya Zverev, licensed WTFPL.
use strict;
use POSIX qw(strftime);
use HTML::Template;
use File::Basename;
use Getopt::Long;
<?php
$rq_bbox = $_REQUEST['bbox'] or $rq_bbox = $_REQUEST['BBOX'];
$bbox = split(',', $rq_bbox);
$rq_w = $_REQUEST['width'] or $rq_w = $_REQUEST['WIDTH'];
$rq_h = $_REQUEST['height'] or $rq_h = $_REQUEST['HEIGHT'];
$url = "http://maps.rosreestr.ru/ArcGIS/rest/services/Cadastre/Cadastre/MapServer/export?dpi=100&transparent=true&format=png8&bbox={xmin:$bbox[0],ymin:$bbox[1],xmax:$bbox[2],ymax:$bbox[3],spatialReference:{wkid:4326}}&bboxSR=4326&imageSR=102113&size=$rq_w,$rq_h&f=image";
header('Location: ' . $url);