This file contains 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
'use strict'; | |
exports.Tile = {read: readTile, write: writeTile}; | |
exports.Layer = {read: readLayer, write: writeLayer}; | |
exports.Feature = {read: readFeature, write: writeFeature}; | |
exports.Value = {read: readValue, write: writeValue}; | |
// decoding vector tile | |
function readTile(pbf, end) { |
This file contains 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
function test() { | |
for (var i = 0, array = []; i < 1000; i++) array.push(i, i); | |
} | |
var start = Date.now(), ops = 0; | |
do { test(); ops++; } while (Date.now() - start < 1000); | |
(typeof console !== 'undefined' ? console.log : print)(ops + ' ops/s'); |
This file contains 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 start = now(), | |
ops = 0; | |
while (now() - start < 1) { | |
// [...] routine to bench goes here | |
ops++; | |
} | |
console.log(Math.round(ops / (now() - start)) + ' ops/s'); |
This file contains 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
// TypeScript type definitions to use for reference when porting Earcut to other languages | |
declare module 'earcut' { | |
interface Point extends Array<number> {} | |
interface Ring extends Array<Point> {} | |
interface Polygon extends Array<Ring> {} | |
interface Triangles extends Array<Point> {} |
This file contains 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
diff --git a/src/layer/tile/GridLayer.js b/src/layer/tile/GridLayer.js | |
index d98994f..596d47f 100644 | |
--- a/src/layer/tile/GridLayer.js | |
+++ b/src/layer/tile/GridLayer.js | |
@@ -301,26 +301,29 @@ L.GridLayer = L.Layer.extend({ | |
}, | |
_viewReset: function (e) { | |
- var map = this._map; | |
- this._reset(map.getCenter(), map.getZoom(), e && e.hard); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Animation Test</title> | |
<style> | |
html, body { | |
height: 100%; | |
} | |
button { |
This file contains 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
/* | |
@class Control.Attribution | |
@aka L.Control.Attribution; @inherits Control | |
The attribution control allows you to display attribution data in a small text box on a map. | |
It is put on the map by default unless you set its [`attributionControl` option](#map-attributioncontrol) to `false`, | |
and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) automatically. | |
Extends Control. | |
*/ |
This file contains 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
<!DOCTYPE html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> | |
<button onclick="displayResult()">Search</button> | |
<script> | |
var numEvals; | |
function displayResult() { |
This file contains 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 tile = require('./points.json'); | |
tile.layers.forEach(function (layer) { | |
layer.id = []; | |
layer.geometry = []; | |
layer.tags = []; | |
var x0 = 0; |
This file contains 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 map = new L.Map('map'); | |
map.setView(new L.LatLng(51.505, -0.09), 13); | |
var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/.../{z}/{x}/{y}.png', { | |
attribution: '[...]' | |
}); | |
map.addLayer(cloudmade); | |
var marker = new L.Marker(new L.LatLng(51.5, -0.09)); | |
marker.bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup(); |
OlderNewer