Skip to content

Instantly share code, notes, and snippets.

docker run \
-v /absolute-path-to-your-data.osm.pbf:/data.osm.pbf \
-v openstreetmap-data:/var/lib/postgresql/10/main \
overv/openstreetmap-tile-server import
docker run -p 80:80 -v openstreetmap-data:/var/lib/postgresql/10/main \
-v openstreetmap-rendered-tiles:/var/lib/mod_tile \
-d overv/openstreetmap-tile-server run
yarn
yarn run examples
<TileLayer
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
<TileLayer
attribution='&amp;copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
url="http://localhost/tile/{z}/{x}/{y}.png"
/>
yarn
yarn start
const providers = {
osm: (x, y, z) => {
const s = String.fromCharCode(97 + (x + y + z) % 3)
return `https://${s}.tile.openstreetmap.org/${z}/${x}/${y}.png`
}
osm: (x, y, z) => {
const s = String.fromCharCode(97 + (x + y + z) % 3)
return `http://localhost/tile/${z}/${x}/${y}.png`
},
import java.util.concurrent.ThreadLocalRandom
val random: ThreadLocalRandom = ThreadLocalRandom.current()
(1 to 100).foreach(i => println(random.nextLong(1,10) + " x " + random.nextLong(1,10) + " = ......"))
import java.util.concurrent.ThreadLocalRandom
val random: ThreadLocalRandom = ThreadLocalRandom.current()
def getNumber(): (Int, Int) = {
val n = random.nextLong(1,100)
val d = random.nextLong(1,10)
if(n % d == 0 && n / d < 11 && n != d) (n.toInt, d.toInt)
else getNumber()
}