This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var manufacturer; | |
| switch ( device ) { | |
| case 'iPhone': | |
| manufacturer = 'Apple'; | |
| break; | |
| case 'Windows 8': | |
| manufacturer = 'Microsoft'; | |
| break; | |
| case 'Chrome': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var manufacturer = { | |
| 'iPhone' : 'Apple', | |
| 'Windows 8' : 'Microsoft', | |
| 'Chrome' : 'Google', | |
| 'default' : 'Unknown manufacturer' | |
| } | |
| var who = manufacturer[device] || manufacturer['default']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $.ajaxPrefilter(function(options, originalOptions, jqXHR){ | |
| if(!options.ajaxCache) { | |
| return; | |
| } | |
| var cacheOptions = options.ajaxCache; | |
| var timeToLive = cacheOptions.timeToLive || 1000 * 60 * 60, //1hour | |
| cacheKey = cacheOptions.cacheKey || options.type + options.url, | |
| cached = JSON.parse(localStorage.getItem(cacheKey)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # ogrcat | |
| # produces line-delimited geojson features | |
| # Like `fio cat` but uses ogr2ogr under the hood | |
| ECHO_FEATURES="" | |
| ogr2ogr -f GeoJSON /vsistdout/ "$@" | while read line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ViewController: UIViewController { | |
| let baseLayer = CAShapeLayer() | |
| var pinchX: CGFloat = 0 | |
| var pinchY: CGFloat = 0 | |
| var panStart = CGPoint() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private func drawLndare() { | |
| let style = SLDStyleSet(viewC: globeView, useLayerNames: true, relativeDrawPriority: 100) | |
| let styleUrl = Bundle.main.url(forResource: "my-sld", withExtension: "sld") | |
| style!.loadSldURL(styleUrl) | |
| let tileSource = MaplyMBTileSource(mbTiles: "out") | |
| vecTiles = MapboxVectorTilesPagingDelegate(mbTiles: tileSource!, style: style!, viewC: globeView) | |
| layer = MaplyQuadPagingLayer(coordSystem: tileSource!.coordSys, delegate: vecTiles!) | |
| layer?.flipY = false | |
| //layer?.importance = 256*256 |