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
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 |
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
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 |
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
yarn | |
yarn run examples |
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
<TileLayer | |
attribution='&copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' | |
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" | |
/> | |
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
<TileLayer | |
attribution='&copy <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' | |
url="http://localhost/tile/{z}/{x}/{y}.png" | |
/> | |
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
yarn | |
yarn start |
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
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` | |
} | |
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
osm: (x, y, z) => { | |
const s = String.fromCharCode(97 + (x + y + z) % 3) | |
return `http://localhost/tile/${z}/${x}/${y}.png` | |
}, | |
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
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) + " = ......")) |
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
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() | |
} |