پنل تحت وب مدیریت V2ray و ساخت کاربر و مدیریت سرور
mkdir x-ui && cd x-ui
docker run -itd --network=host \
-v $PWD/db/:/etc/x-ui/ \
-v $PWD/cert/:/root/cert/ \
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
Detailed walk through of building extraction using postgis
First lets pull a data layer from of openstreetmap. You can do this any which way you’d like, as there are a variety of methods for pulling openstreetmap data from their database. Check the [wiki] (http://wiki.openstreetmap.org/wiki/Downloading_data) for a comprehensive list. My favourite method thus far is pulling the data straight into QGIS using the open layers plugin. For those who may want to explore this method, check [this tutorial] (http://www.qgistutorials.com/en/docs/downloading_osm_data.html). For building extraction you only need building footprints, and include the building tags. Not all polygons are of type building in OSM, so we can download all the polygons, and then filter the layer for only polygons tagged as buildings.
LiDAR data was pulled from USGS via the Earth Explorer site. [Here] (http://earthobservatory.nasa.gov/blogs/ele
var map = L.map( 'map' ); | |
L.Map.prototype.panToOffset = function (latlng, offset, options) { | |
var x = this.latLngToContainerPoint(latlng).x - offset[0] | |
var y = this.latLngToContainerPoint(latlng).y - offset[1] | |
var point = this.containerPointToLatLng([x, y]) | |
return this.setView(point, this._zoom, { pan: options }) | |
} | |
function centerMap(){ |
The difference between XYZ and TMS tiles and how to convert between them
Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles
ending in /0/0/0.png
or something. Sometimes if it's a script, it'll look like
&z=0&y=0&x=0
instead. Anyway, these are usually maps in Spherical Mercator.
Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.
Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.
/** | |
* Wraps a `Function` with another `Function`. This allows | |
* the wrapper function to intercept and manipulate the | |
* return value of the orginal function. | |
* @param {Function} fn The function to wrap | |
* @param {Function} wrapper The wrapper function | |
* @return {Function} Return the wrapped function | |
*/ | |
function wrap(fn, wrapper) { | |
return function() { |
// Tile server using the node web framework Express (http://expressjs.com). | |
var app = require('express').createServer(); | |
var tilelive = require('tilelive'); | |
require('tilelive-mapnik').registerProtocols(tilelive); | |
var filename = __dirname + '/' + 'stylesheet.xml'; | |
tilelive.load('mapnik://' + filename, function(err, source) { | |
if (err) throw err; | |
app.get('/:z/:x/:y.*', function(req, res) { | |
source.getTile(req.param('z'), req.param('x'), req.param('y'), function(err, tile, headers) { | |
// `err` is an error object when generation failed, otherwise null. |