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
// In React JS project go to package.json | |
// Inside the 'scripts' block, change | |
"start":"react-scripts start" | |
// to | |
"start":"react-scripts build && (cd backend && yarn start)", | |
// in which, backen is the root directory of node-express app | |
// and add | |
"start-client": "react-scripts start", //starts react app on port=3000 | |
// now in node-express root directory, open server.js (maybe app.js) |
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
// add | |
app.use(express.static(path.join(__dirname, "..", "build"))); |
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
_latLong2Merc = (_lat, _lon) => { | |
/* | |
_lat => Latitude in decimal degree (Number) | |
_lon => Longitude in decimal degree (Number) | |
*/ | |
var r_major = 6378137.000 | |
var lon_rad = (_lon / 180.0 * Math.PI) | |
var x = r_major * lon_rad | |
var scale = x / _lon | |
var y = 180.0 / Math.PI * Math.log(Math.tan(Math.PI / 4.0 + _lat * (Math.PI / 180.0) / 2.0)) * scale |
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 os | |
import arcpy | |
def mxdToKMZ(url): | |
if os.path.exists(path): | |
mxd_dir = os.path.split(path)[0] | |
kmz_dir = mxd_dir + "/kml" | |
os.mkdir(kmz_dir) | |
mxd = arcpy.mapping.MapDocument(r"path\to\mxd\file\name.mxd") |
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 time | |
import random | |
from multiprocessing import Process | |
workers = [] | |
def do_something(a:str, b:int): | |
""" | |
This is your main function that you want to be | |
execute "n" times but much faster than usual by |
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
/* | |
In this example I showed that users can click on map and | |
get link of image tile and containt location of clicked position. | |
I used Leaflet.js library and a ArcGIS tile service to prove my work. | |
You can easily change "samplePosition" and "initialZoom" to move to | |
your favourite location and zoom. | |
Just open browser console log and click on the link that is appread | |
after clicking on map. | |
*/ |