-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproj.html
13 lines (13 loc) · 12.3 KB
/
proj.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<!doctype html>
<html>
<head>
<meta charset=utf-8/>
<title>proj.html</title>
</head>
<body>
<ul>
<li><a target=_blank href="http://glat.info/hafi/?osm=1#o=7KjcK5K99varJin_brJXJ(7ZnZnvesuv_crater5J7JlngJ5J1%3E.%3E2%3A%2C0%7B13%3A00%2C%7B%7D%7D9JlatJ5J%3E0.%40211%3A%7B%3E10%2C03%2C2J6Zn9Jvesuv_summit5J7JlngJ5J1%3E.%3E2%403%3E%3E%7B%2C%2C%2C%2C%2C%2C%2C9JlatJ5J%3E0.%4022%7B32%7BJ6Zn9Jrochebrune5J7lng5J%7D.%7B%40%7B%3A0%7D%7B%2C%2C%2C%2C%2C%2C%7D9Jlat5J%3E%3E.%40222%2C32J6Zn9JmonvisoJ5J7lng5%7B.0%40%2C%2C%40%7B%2C%2C%2C%2C%2C%2C%2C%3E%409Jlat5%3E%3E.%7D%7D%7B%3E3%2C%7B6ZnZn6).monvisoQZnZnvarJuse_osmJXJYHZZ%3F%26WosmX1(%3F5%26%7C%24)Y.test(Jlocation.searchJ)QJYYJelseJmapboxZnvarJmapbox_tokenX'pk.ey%201Ijoi%5C2xhdGhvd%5D%3BiLC%20hIjoi%2F2pyN%5Bdvd%5D1nM%3D%2FyNTN3cnpmeTBsMDAxdy%20%2C.%7BsrSh%7DOeE1%7D%3Bf_p%5BO%5Degvw'QZnZnYYJ--------------JmapZnZnvarJmapJXJL.map('mapid').setView(7JlngJ5J%7D.%3E10%7B%3A0%3E%3E%40%7B03%7B%7D%7D9JlatJ5J%3E%3A.0122%7D0%3A%7D22%4021%7BJ69J13)QQZnZnifJ(use_osm)Zn7ZnYYJcreateJtheJtileJlayerJwithJcorrectJattributionZnZtvarJosmUrlX'https5YY7s6.tile.openstreetmap.orgY7z6Y7x6Y7y6.png'QZnZtvarJosmAttribX'MapJdataJ%C2%A9JqaJhrefXZKhttps5YYopenstreetmap.orgZK4OpenStreetMapqYa4Jcontributors'QZnZtvarJosmJXJL.tileLayer(osmUrl9J7min%5Coom5J09Jmax%5Coom5J1%2C9Jattribution5JosmAttrib6)QZtZtZnZnmap.addLayer(osm)QZn6ZnelseZn7ZnL.tileLayer('https5YYapi.tiles.mapbox.comYv%3EY7id6Y7z6Y7x6Y7y6.png%3Faccess_tokenX7accessToken6'9J7Zn~1attribution5J'MapJdataJ%26copyQJqaJhrefXZKhttps5YYwww.openstreetmap.orgYZK4OpenStreetMapqYa4Jcontributors9JqaJhrefXZKhttps5YYcreativecommons.orgYlicensesYby-saY2.0YZK4CC-B%2F-SAqYa49JImageryJ%C2%A9JqaJhrefXZKhttps5YYwww.mapbox.comYZK4MapboxqYa4'9Zn~1max%5Coom5J1%409Zn~1id5J'mapbox.streets'9Zn~1accessToken5Jmapbox_tokenZn6).addTo(map)QZn6ZnZnYYJ--------------ZnZn~1varJAMJXJ76Zn~19~6PIJXJMath.PIZnZn~19JJDEG_2_RADJXJPIJYJ1%400Zn~19JJRAD_2_DEGJXJ1%400JYJPIZnZn~19JSM_MA%3D_LATJXJ%40%3A.0%3A112%40%7B%7B%2C%40Zn~19JSM_MIN_LATJXJ-SM_MA%3D_LATZnZn~19JDEG_2_RAD_DIV_2JXJDEG_2_RADJYJ2Zn~19JRAD_2_DEG_MUL_2JXJRAD_2_DEGJ*J2Zn~19JPI_DIV_%3E~5XJPIJYJ%3EZnZn~1QZnZn~1YYJ----------JPublicJAPIZnZn~1AM.DEG_2_RAD~5XJDEG_2_RADQZn~1AM.RAD_2_DEG~5XJRAD_2_DEGQZnZn~1AM.project_SM~4XJAM_project_SMQZnZn~1AM.unproject_SM~2XJAM_unproject_SMQZnZn~1YYJ----------JPublicJAPIJimplementationZnZn~1functionJAM_project_SM(JY*objectJwithJpropertiesJ%60lat%60JandJ%60lng%60JinJdegrees*YlatLngJ)Zn~1YYJSphericalJmercatorJprojectionJ(likeJLeaflet's)Zn~1YYZn~1YYJInput5JlatYlngJinJdegreesJ(lngJMUSTJBEJwithinJH-1%400J!1%400W)Zn~1YYJOutput5JxYyJbetweenJ-PIJandJ!PIZn~1YYZn~1YYJguillaume.lathoud8outdooractive.comZn~17Zn~5varJlat2JXJMath.min(JSM_MA%3D_LAT9JMath.max(JSM_MIN_LAT9JlatLng.latJ))QZnZn~5returnJ7Zn~7JJx~05JlatLng.lngJ*JDEG_2_RADZn~7JJ9JyJ5JMath.log(JMath.tan(JPI_DIV_%3EJ!Jlat2J*JDEG_2_RAD_DIV_2J)J)Zn~56QZn~16ZnZn~1functionJAM_unproject_SM(JY*objectJwithJpropertiesJ%60x%60JandJ%60y%60JbetweenJ-PIJandJ!PI*YxyJ)Zn~1YYJInverseJsphericalJmercatorJprojectionJ(likeJLeaflet's)Zn~1YYZn~1YYJInput5JxYyJbetweenJ-PIJandJ!PIZn~1YYJOutput5JlatYlngJinJdegrees.Zn~1YYZn~1YYJguillaume.lathoud8outdooractive.comZn~17Zn~5returnJ7Zn~7JJlng~05Jxy.xJ*JRAD_2_DEGZn~7JJ9JlatJ5JRAD_2_DEG_MUL_2J*J(Math.atan(JMath.exp(Jxy.yJ)J)J-JPI_DIV_%3E)Zn~56Zn~5Zn~16ZnZnYYJ----------------ZnZnY*Zncoordinates5ZnZnpicJOJdeJCombeynot5J%7D.%3E10%7B%3A0%3E%3E%40%7B03%7B%7D%7D9%3E%3A.0122%7D0%3A%7D22%4021%7B.31%3A%3AZnZnRuebezahlssofa5J1%3E.%7B%7D%3A%3E3%2C%2C2%7B%3A%7B%7B%2C%7B29%3A0.%40%3E%7B%7B1%3A20%40131%3A%3A9%3A%3E%2C.%7B%7B%7D%7B3%3A%2CZnZnVesuv5Znsummit5JH1%3E.%3E2%403%3E%3E%7B%2C%2C%2C%2C%2C%2C%2C9%3E0.%4022%7B32%7B9123%40.%3A%7B32%2C%7D%3AWZncrater5JH1%3E.%3E2%3A%2C0%7B13%3A00%2C%7B%7D%7D9%3E0.%40211%3A%7B%3E10%2C03%2C29%2C%7B2.%40%3A%2C%2C121WZnZndesiredJextrapolation5JoverJlngJH-%3A0.09J!%3A0.0WZn*YZnZnZnYYJ-JInputsJZnZnvarJpic_OJXJ7JlngJ5J%7D.%3E10%7B%3A0%3E%3E%40%7B03%7B%7D%7D9JlatJ5J%3E%3A.0122%7D0%3A%7D22%4021%7BJ6Zn9~0ruebeJXJ7JlngJ5J1%3E.%7B%7D%3A%3E3%2C%2C2%7B%3A%7B%7B%2C%7B29JlatJ5J%3A0.%40%3E%7B%7B1%3A20%40131%3A%3AJ6ZnZn9~0desired_0JXJ7JlngJ5J-%3A0.09JlatJ5J0.0J6Zn9~0desired_1JXJ7JlngJ5J!%3A0.09JlatJ5J0.0J6ZnQZnZnYYJ-JIntermediaryJvalues5JprojectZnZnvarJpic_O_xyJXJAM_project_SM(Jpic_OJ)Zn9~0ruebe_xyJXJAM_project_SM(JruebeJ)Zn9~0in_br_xyJXJAM_project_SM(Jin_brJ)ZnZn9~0x0JXJAM_project_SM(Jdesired_0J).xZn9~0x1JXJAM_project_SM(Jdesired_1J).xZnQZnZnYYJ-JIntermediaryJvalues5JextrapolateZnZnvarJtop_left_xyJXJ7JxJ5Jx09JyJ5Jextrapolate_y_of_x(Jx09Jpic_O_xy9Jin_br_xyJ)J6Zn9~0bot_righ_xyJXJ7JxJ5Jx19JyJ5Jextrapolate_y_of_x(Jx19Jpic_O_xy9Jin_br_xyJ)J6ZnZn9~0bot_left_xyJXJ7JxJ5Jx09JyJ5Jextrapolate_y_of_x(Jx09Jpic_O_xy9Jruebe_xyJ)J6Zn9~0top_righ_xyJXJ7JxJ5Jx19JyJ5Jextrapolate_y_of_x(Jx19Jpic_O_xy9Jruebe_xyJ)J6ZnQZnZnYYJ-JOutputsJ7lat9lng6ZnZnvarJtop_leftJXJAM_unproject_SM(Jtop_left_xyJ)Zn9~0bot_righJXJAM_unproject_SM(Jbot_righ_xyJ)ZnZn9~0bot_leftJXJAM_unproject_SM(Jbot_left_xyJ)Zn9~0top_righJXJAM_unproject_SM(Jtop_righ_xyJ)ZnQZnZnYYJ-JDrawJpointsJandJlinesJonJtheJmapZnZnvarJtlbrJXJL.polyline(Htop_left9bot_righW97color5'red'6).addTo(map)QZnvarJbltrJXJL.polyline(Hbot_left9top_righW97color5'red'6).addTo(map)QZnZnmap.fitBounds(Htop_left9bot_righW)QZnZnconsole.log('bounds5JHbot_left9bot_righ9top_left9top_righW'9%20SON.stringify(Hbot_left9bot_righ9top_left9top_righW))QZnYYJ---------------JRemainingJtoolsJ(functionJdeclarations)ZnZnfunctionJextrapolate_y_of_x(Jx9Ja_xy9Jb_xyJ)Zn7ZnvarJaxJXJa_xy.x9JayJXJa_xy.yZn9~0bxJXJb_xy.x9JbyJXJb_xy.yZnQZnreturnJayJ!J(x-ax)J*J(by-ay)JYJ(bx-ax)QZn6K9KhcK5K99qlinkJrelXZKstylesheetZKJhrefXZKhttps5YYunpkg.comYleaflet81.%3E.0YdistYleaflet.cssZKZn~0integrityXZKsha%3A12-puBpdR0%7B%2C%40O%5CvTTbP%3EA%40IxYl!A%3Ed%5BDD0DG%3C%2F%5D%7DR%3B!%2CjxkRFclaxx%3BbYS%20A%5D%5Cf%5DAkuye%3BUytO%7B!%7BN%3E%3B%22rDh!drAXXZKZn~0crossoriginXZKZKY4ZnJq%2B--JMakeJsureJyouJputJthisJAFTERJLeaflet'sJCSSJ--4ZnJqscriptJsrcXZKhttps5YYunpkg.comYleaflet81.%3E.0YdistYleaflet.jsZKZn~0integrityXZKsha%3A12-%3BVftw%5CF%3CvtRNi0%5CyCtsznl%22S%5DOStnDORoefr1eny%3C%3AmVL%3Etm%22B3SYEnC3rR%20cxCPavG10IcrVGSmPh%7D%3Bw%3AlwrgXXZKZn~0crossoriginXZKZK4qYscript4ZnZnJqdivJidXZKmapidZK4qYdiv4ZnK9KcssK5K%23mapidJ7Jposition5JstaticQJheight5J%7D00pxQJwidth5J100%25Q6K6">Azimuth-X: Pic Ouest de Combeynot et alentours</a> <a href="http://glat.info/hafi/?osm=0#o=7KjcK5K99varJin_brJXJ(7ZnZnvesuv_crater5J7JlngJ5J1%3E.%3E2%3A%2C0%7B13%3A00%2C%7B%7D%7D9JlatJ5J%3E0.%40211%3A%7B%3E10%2C03%2C2J6Zn9Jvesuv_summit5J7JlngJ5J1%3E.%3E2%403%3E%3E%7B%2C%2C%2C%2C%2C%2C%2C9JlatJ5J%3E0.%4022%7B32%7BJ6Zn9Jrochebrune5J7lng5J%7D.%7B%40%7B%3A0%7D%7B%2C%2C%2C%2C%2C%2C%7D9Jlat5J%3E%3E.%40222%2C32J6Zn9JmonvisoJ5J7lng5%7B.0%40%2C%2C%40%7B%2C%2C%2C%2C%2C%2C%2C%3E%409Jlat5%3E%3E.%7D%7D%7B%3E3%2C%7B6ZnZn6).monvisoQZnZnvarJuse_osmJXJYHZZ%3F%26WosmX1(%3F5%26%7C%24)Y.test(Jlocation.searchJ)QJYYJelseJmapboxZnvarJmapbox_tokenX'pk.ey%201Ijoi%5C2xhdGhvd%5D%3BiLC%20hIjoi%2F2pyN%5Bdvd%5D1nM%3D%2FyNTN3cnpmeTBsMDAxdy%20%2C.%7BsrSh%7DOeE1%7D%3Bf_p%5BO%5Degvw'QZnZnYYJ--------------JmapZnZnvarJmapJXJL.map('mapid').setView(7JlngJ5J%7D.%3E10%7B%3A0%3E%3E%40%7B03%7B%7D%7D9JlatJ5J%3E%3A.0122%7D0%3A%7D22%4021%7BJ69J13)QQZnZnifJ(use_osm)Zn7ZnYYJcreateJtheJtileJlayerJwithJcorrectJattributionZnZtvarJosmUrlX'https5YY7s6.tile.openstreetmap.orgY7z6Y7x6Y7y6.png'QZnZtvarJosmAttribX'MapJdataJ%C2%A9JqaJhrefXZKhttps5YYopenstreetmap.orgZK4OpenStreetMapqYa4Jcontributors'QZnZtvarJosmJXJL.tileLayer(osmUrl9J7min%5Coom5J09Jmax%5Coom5J1%2C9Jattribution5JosmAttrib6)QZtZtZnZnmap.addLayer(osm)QZn6ZnelseZn7ZnL.tileLayer('https5YYapi.tiles.mapbox.comYv%3EY7id6Y7z6Y7x6Y7y6.png%3Faccess_tokenX7accessToken6'9J7Zn~1attribution5J'MapJdataJ%26copyQJqaJhrefXZKhttps5YYwww.openstreetmap.orgYZK4OpenStreetMapqYa4Jcontributors9JqaJhrefXZKhttps5YYcreativecommons.orgYlicensesYby-saY2.0YZK4CC-B%2F-SAqYa49JImageryJ%C2%A9JqaJhrefXZKhttps5YYwww.mapbox.comYZK4MapboxqYa4'9Zn~1max%5Coom5J1%409Zn~1id5J'mapbox.streets'9Zn~1accessToken5Jmapbox_tokenZn6).addTo(map)QZn6ZnZnYYJ--------------ZnZn~1varJAMJXJ76Zn~19~6PIJXJMath.PIZnZn~19JJDEG_2_RADJXJPIJYJ1%400Zn~19JJRAD_2_DEGJXJ1%400JYJPIZnZn~19JSM_MA%3D_LATJXJ%40%3A.0%3A112%40%7B%7B%2C%40Zn~19JSM_MIN_LATJXJ-SM_MA%3D_LATZnZn~19JDEG_2_RAD_DIV_2JXJDEG_2_RADJYJ2Zn~19JRAD_2_DEG_MUL_2JXJRAD_2_DEGJ*J2Zn~19JPI_DIV_%3E~5XJPIJYJ%3EZnZn~1QZnZn~1YYJ----------JPublicJAPIZnZn~1AM.DEG_2_RAD~5XJDEG_2_RADQZn~1AM.RAD_2_DEG~5XJRAD_2_DEGQZnZn~1AM.project_SM~4XJAM_project_SMQZnZn~1AM.unproject_SM~2XJAM_unproject_SMQZnZn~1YYJ----------JPublicJAPIJimplementationZnZn~1functionJAM_project_SM(JY*objectJwithJpropertiesJ%60lat%60JandJ%60lng%60JinJdegrees*YlatLngJ)Zn~1YYJSphericalJmercatorJprojectionJ(likeJLeaflet's)Zn~1YYZn~1YYJInput5JlatYlngJinJdegreesJ(lngJMUSTJBEJwithinJH-1%400J!1%400W)Zn~1YYJOutput5JxYyJbetweenJ-PIJandJ!PIZn~1YYZn~1YYJguillaume.lathoud8outdooractive.comZn~17Zn~5varJlat2JXJMath.min(JSM_MA%3D_LAT9JMath.max(JSM_MIN_LAT9JlatLng.latJ))QZnZn~5returnJ7Zn~7JJx~05JlatLng.lngJ*JDEG_2_RADZn~7JJ9JyJ5JMath.log(JMath.tan(JPI_DIV_%3EJ!Jlat2J*JDEG_2_RAD_DIV_2J)J)Zn~56QZn~16ZnZn~1functionJAM_unproject_SM(JY*objectJwithJpropertiesJ%60x%60JandJ%60y%60JbetweenJ-PIJandJ!PI*YxyJ)Zn~1YYJInverseJsphericalJmercatorJprojectionJ(likeJLeaflet's)Zn~1YYZn~1YYJInput5JxYyJbetweenJ-PIJandJ!PIZn~1YYJOutput5JlatYlngJinJdegrees.Zn~1YYZn~1YYJguillaume.lathoud8outdooractive.comZn~17Zn~5returnJ7Zn~7JJlng~05Jxy.xJ*JRAD_2_DEGZn~7JJ9JlatJ5JRAD_2_DEG_MUL_2J*J(Math.atan(JMath.exp(Jxy.yJ)J)J-JPI_DIV_%3E)Zn~56Zn~5Zn~16ZnZnYYJ----------------ZnZnY*Zncoordinates5ZnZnpicJOJdeJCombeynot5J%7D.%3E10%7B%3A0%3E%3E%40%7B03%7B%7D%7D9%3E%3A.0122%7D0%3A%7D22%4021%7B.31%3A%3AZnZnRuebezahlssofa5J1%3E.%7B%7D%3A%3E3%2C%2C2%7B%3A%7B%7B%2C%7B29%3A0.%40%3E%7B%7B1%3A20%40131%3A%3A9%3A%3E%2C.%7B%7B%7D%7B3%3A%2CZnZnVesuv5Znsummit5JH1%3E.%3E2%403%3E%3E%7B%2C%2C%2C%2C%2C%2C%2C9%3E0.%4022%7B32%7B9123%40.%3A%7B32%2C%7D%3AWZncrater5JH1%3E.%3E2%3A%2C0%7B13%3A00%2C%7B%7D%7D9%3E0.%40211%3A%7B%3E10%2C03%2C29%2C%7B2.%40%3A%2C%2C121WZnZndesiredJextrapolation5JoverJlngJH-%3A0.09J!%3A0.0WZn*YZnZnZnYYJ-JInputsJZnZnvarJpic_OJXJ7JlngJ5J%7D.%3E10%7B%3A0%3E%3E%40%7B03%7B%7D%7D9JlatJ5J%3E%3A.0122%7D0%3A%7D22%4021%7BJ6Zn9~0ruebeJXJ7JlngJ5J1%3E.%7B%7D%3A%3E3%2C%2C2%7B%3A%7B%7B%2C%7B29JlatJ5J%3A0.%40%3E%7B%7B1%3A20%40131%3A%3AJ6ZnZn9~0desired_0JXJ7JlngJ5J-%3A0.09JlatJ5J0.0J6Zn9~0desired_1JXJ7JlngJ5J!%3A0.09JlatJ5J0.0J6ZnQZnZnYYJ-JIntermediaryJvalues5JprojectZnZnvarJpic_O_xyJXJAM_project_SM(Jpic_OJ)Zn9~0ruebe_xyJXJAM_project_SM(JruebeJ)Zn9~0in_br_xyJXJAM_project_SM(Jin_brJ)ZnZn9~0x0JXJAM_project_SM(Jdesired_0J).xZn9~0x1JXJAM_project_SM(Jdesired_1J).xZnQZnZnYYJ-JIntermediaryJvalues5JextrapolateZnZnvarJtop_left_xyJXJ7JxJ5Jx09JyJ5Jextrapolate_y_of_x(Jx09Jpic_O_xy9Jin_br_xyJ)J6Zn9~0bot_righ_xyJXJ7JxJ5Jx19JyJ5Jextrapolate_y_of_x(Jx19Jpic_O_xy9Jin_br_xyJ)J6ZnZn9~0bot_left_xyJXJ7JxJ5Jx09JyJ5Jextrapolate_y_of_x(Jx09Jpic_O_xy9Jruebe_xyJ)J6Zn9~0top_righ_xyJXJ7JxJ5Jx19JyJ5Jextrapolate_y_of_x(Jx19Jpic_O_xy9Jruebe_xyJ)J6ZnQZnZnYYJ-JOutputsJ7lat9lng6ZnZnvarJtop_leftJXJAM_unproject_SM(Jtop_left_xyJ)Zn9~0bot_righJXJAM_unproject_SM(Jbot_righ_xyJ)ZnZn9~0bot_leftJXJAM_unproject_SM(Jbot_left_xyJ)Zn9~0top_righJXJAM_unproject_SM(Jtop_righ_xyJ)ZnQZnZnYYJ-JDrawJpointsJandJlinesJonJtheJmapZnZnvarJtlbrJXJL.polyline(Htop_left9bot_righW97color5'red'6).addTo(map)QZnvarJbltrJXJL.polyline(Hbot_left9top_righW97color5'red'6).addTo(map)QZnZnmap.fitBounds(Htop_left9bot_righW)QZnZnconsole.log('bounds5JHbot_left9bot_righ9top_left9top_righW'9%20SON.stringify(Hbot_left9bot_righ9top_left9top_righW))QZnYYJ---------------JRemainingJtoolsJ(functionJdeclarations)ZnZnfunctionJextrapolate_y_of_x(Jx9Ja_xy9Jb_xyJ)Zn7ZnvarJaxJXJa_xy.x9JayJXJa_xy.yZn9~0bxJXJb_xy.x9JbyJXJb_xy.yZnQZnreturnJayJ!J(x-ax)J*J(by-ay)JYJ(bx-ax)QZn6K9KhcK5K99qlinkJrelXZKstylesheetZKJhrefXZKhttps5YYunpkg.comYleaflet81.%3E.0YdistYleaflet.cssZKZn~0integrityXZKsha%3A12-puBpdR0%7B%2C%40O%5CvTTbP%3EA%40IxYl!A%3Ed%5BDD0DG%3C%2F%5D%7DR%3B!%2CjxkRFclaxx%3BbYS%20A%5D%5Cf%5DAkuye%3BUytO%7B!%7BN%3E%3B%22rDh!drAXXZKZn~0crossoriginXZKZKY4ZnJq%2B--JMakeJsureJyouJputJthisJAFTERJLeaflet'sJCSSJ--4ZnJqscriptJsrcXZKhttps5YYunpkg.comYleaflet81.%3E.0YdistYleaflet.jsZKZn~0integrityXZKsha%3A12-%3BVftw%5CF%3CvtRNi0%5CyCtsznl%22S%5DOStnDORoefr1eny%3C%3AmVL%3Etm%22B3SYEnC3rR%20cxCPavG10IcrVGSmPh%7D%3Bw%3AlwrgXXZKZn~0crossoriginXZKZK4qYscript4ZnZnJqdivJidXZKmapidZK4qYdiv4ZnK9KcssK5K%23mapidJ7Jposition5JstaticQJheight5J%7D00pxQJwidth5J100%25Q6K6">(without OSM: faster but no summit)</a>
<code>[{"lng":-50,"lat":-8.34603406053913},{"lng":50,"lat":18.953477558129155},{"lng":-50,"lat":66.8706241244624},{"lng":50,"lat":68.80090415063631}]</code>
</ul>
</body>
</html>