Skip to content

Instantly share code, notes, and snippets.

View Zverik's full-sized avatar

Ilya Zverev Zverik

View GitHub Profile
<?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);
@Zverik
Zverik / osm-shields.py
Created July 4, 2014 10:36
Generate SVG shields for osm.org style
#!/usr/bin/python
# Generate SVG shields for https://github.com/gravitystorm/openstreetmap-carto
WIDTHS = {
1: 0.0, 2: 7.25, 3: 14.5, 4: 21.0,
5: 28.5, 6: 34.5, 7: 41.25, 8: 48.0,
9: 52.5, 10: 57.75, 11: 62.75
}
TYPES = { 'mot': '#7788a1', 'pri': '#bb7b7f', 'sec': '#c6ad84', 'ter': '#c4c68f' }
@Zverik
Zverik / Leaflet.LimitZoom.js
Created June 26, 2014 11:03
Leaflet LimitZoom plugin
// Limit leaflet map zoom to a list of variants
// Written by Ilya Zverev, licensed WTFPL
L.Map.mergeOptions({
zooms: [] // array of integers
});
L.Map.include({
_limitZoom: function (zoom) {
var zooms = this.options.zooms;