Skip to content

Commit

Permalink
elev get2 kml
Browse files Browse the repository at this point in the history
  • Loading branch information
theo-armour committed Oct 16, 2016
1 parent 2f04f06 commit fbd64b6
Show file tree
Hide file tree
Showing 18 changed files with 74,447 additions and 29 deletions.
3,913 changes: 3,913 additions & 0 deletions data-path-kml/oakland-gran-fondo-mini-fondo-13.5-mile.kml

Large diffs are not rendered by default.

32,281 changes: 32,281 additions & 0 deletions data-path-kml/ogf-100-mile-construction-on-palomares.kml

Large diffs are not rendered by default.

32,281 changes: 32,281 additions & 0 deletions data-path-tcx/OGF - 100 Mile Construction on Palomares.tcx

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions data-path-tcx/info.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


tcx to kml

http://veloroutes.org/upload/


http://tcxtools.com/
2 changes: 2 additions & 0 deletions elevations-core3/h-kml-kml/kml-r3.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@

};



KML.readFile = function( files ) {

var reader;
Expand Down
2 changes: 1 addition & 1 deletion elevations-get2/0-def-defaults2/def-defaults2-r1.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

COR.defaults.mapTypeId = 'hybrid';

COR.defaults.nearby = '';
// COR.defaults.nearby = '';

COR.defaults.objectName = 'defaults';
COR.defaults.origin = 'Tenzing-Hillary Airport, Lukla, Nepal';
Expand Down
5 changes: 5 additions & 0 deletions elevations-get2/2-sel-select2/sel-select2-r1.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@

// Menus


// SEL.getMenuDetailsSelectFile() +

// SELdetailsSelectFile.setAttribute('open', 'open');

SEL.getMenuDetailsSelectFile = function() {

var menuDetailsSelectFile =
Expand Down
7 changes: 4 additions & 3 deletions elevations-get2/3-api-map-api2/api-map-api2-r1.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@

API.placeLocation = { lat: place.latitude, lng: place.longitude };

//console.log( '', );

if ( bounds.contains( API.placeLocation ) === true || goDistance === true ) {

API.map.setCenter( API.placeLocation );
Expand All @@ -225,6 +225,8 @@

API.onSetCenter();

API.setClickMenuDetails( API.map.center.lat(), API.map.center.lng() );

} else {

alert( 'curent marker is outside the visible area' );
Expand Down Expand Up @@ -315,9 +317,8 @@

API.markings = [];

COR.results = [];

butMore.disabled = false;
// NEAbutMore.disabled = false;

};

1 change: 1 addition & 0 deletions elevations-get2/6-til-tile2/til-tile2-r1.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

'';


return menuDetailsTilesData;

}
Expand Down
14 changes: 9 additions & 5 deletions elevations-get2/8-nea-nearby2/nea-nearby2-r1.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@

'';

APIapiKey.setAttribute('open', 'open');
// APIapiKey.setAttribute('open', 'open');

APIclickDetails.setAttribute('open', 'open');

Expand All @@ -90,18 +90,22 @@

PAR.setMapParameters();

TIL.listener = API.map.addListener( 'center_changed', TIL.getTilesData );

NEA.listener = API.map.addListener( 'center_changed', NEA.clearAll );

};


API.onSetCenter = function(){

TIL.getTilesData();
// TIL.getTilesData();

COR.results = [];
// COR.results = [];

butMore.disabled = false;
// NEAbutMore.disabled = false;

NEAdivResults.innerHTML = '';
// NEAdivResults.innerHTML = '';

};

Expand Down
62 changes: 46 additions & 16 deletions elevations-get2/8-nea-nearby2/nea-nearby2-r1.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
'<div id=NEAdivNearby >' +

'<p>' +
'<input type=radio name=radPlaceType id=but1 onclick=butMore.disabled=false;NEA.type=NEA.types.naturalFeature; checked />Natural feature' + b +
'<input type=radio name=radPlaceType id=but2 onclick=butMore.disabled=false;NEA.type=NEA.types.locality; />Locality' + b +
'<input type=radio name=radPlaceType id=but3 onclick=butMore.disabled=false;NEA.type=NEA.types.pointOfInterest; />point_of_interest' +
'<input type=radio name=radPlaceType id=but1 onclick=NEAbutMore.disabled=false;NEA.type=NEA.types.naturalFeature; checked />Natural feature' + b +
'<input type=radio name=radPlaceType id=but2 onclick=NEAbutMore.disabled=false;NEA.type=NEA.types.locality; />Locality' + b +
'<input type=radio name=radPlaceType id=but3 onclick=NEAbutMore.disabled=false;NEA.type=NEA.types.pointOfInterest; />point_of_interest' +
'</p>' +

'<button id=butMore onclick=NEA.getNearby(); > get Nearby </button> ' +
'<button id=NEAbutMore onclick=NEA.getNearby(); > get nearby </button> ' +
'<button id=NEAbutClearAll onclick=NEA.clearAll(); > clear all </button> ' +

'</div>' + b +

Expand All @@ -56,22 +57,22 @@

var service, bounds;

// may no longer be needed with center changed listener
if ( NEA.latitude !== COR.place.latitude && NEA.longitude !== COR.place.longitude ) {

butMore.disabled=false;
NEAdivResults.innerHTML = '';

NEA.latitude = COR.place.latitude;
NEA.longitude = COR.place.longitude;

NEA.clearAll();

}

NEA.type = NEA.type || NEA.types.naturalFeature;

COR.place[ NEA.type.type ] = [];
COR.results = [];

if ( !COR.place.types ) { COR.place.types = []; }
if ( !COR.place.types ) { COR.place.types = []; }

if ( !COR.place.types.includes( NEA.type.type ) ) { COR.place.types.push( NEA.type.type ); }

Expand All @@ -90,7 +91,6 @@
new google.maps.LatLng( TIL.tiles.LRlat, TIL.tiles.ULlon ),
new google.maps.LatLng( TIL.tiles.ULlat, TIL.tiles.LRlon )


);

service.nearbySearch( {
Expand Down Expand Up @@ -167,27 +167,27 @@
//console.log( 'results', results );
//console.log( 'pagination.hasNextPage', pagination.hasNextPage );

NEAdivResults.innerHTML = COR.results.length + ' results found';
NEAdivResults.innerHTML = updateResults();

if ( pagination.hasNextPage ) {

butMore.disabled = false;
NEAbutMore.disabled = false;

butMore.addEventListener( 'click', function() {
NEAbutMore.addEventListener( 'click', function() {

butMore.disabled = true;
NEAbutMore.disabled = true;

pagination.nextPage();

});

NEAdivResults.innerHTML = COR.results.length + ' results found. More available,';
NEAdivResults.innerHTML = updateResults() + ' More available,';

} else {

butMore.disabled = true;
NEAbutMore.disabled = true;

NEAdivResults.innerHTML = COR.results.length + ' results found. No more places.';
NEAdivResults.innerHTML = updateResults() + ' No more places.';

}

Expand All @@ -197,9 +197,39 @@

}

function updateResults() {

var txt;

txt = COR.place.natural_feature.length + ' natural features' + b +
COR.place.locality.length + ' localities' + b +
COR.place.point_of_interest.length + ' points of interest' + b +
'';

return txt;

}

}


NEA.clearAll = function() {

if ( !COR.results ) { return; }
console.log( 'NEA clear' );
COR.results = [];

COR.place.types = [];
COR.place.natural_feature = [];
COR.place.locality = [];
COR.place.point_of_interest = [];

NEAbutMore.disabled = false;

NEAdivResults.innerHTML = '';

}

/*
NEA.createMarker = function( place ) {
Expand Down
103 changes: 103 additions & 0 deletions elevations-get2/9-kml-kml2/kml-kml2-r1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!doctype html>
<html lang=en >
<head>
<meta charset=utf-8 >
<title>Elevations Get2 Select R1</title>
<meta name=viewport content='width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no' >
<meta name=description content='Core use GitHuB API to get file names and folders from GitHub Server. A remote LS or DIR service.' >
<meta name=keywords content='cartography,maps,Jaanga,GitHub API,CSS,HTML,JavaScript,GitHub,FOSS' >
<meta name=date content='2016-10-02' >
</head>
<body>
<!--
<script src=https://cdnjs.cloudflare.com/ajax/libs/showdown/1.4.3/showdown.min.js ></script>
-->
<script src=../../elevations-get2/0-def-defaults2/def-defaults2-r1.js ></script>
<script src=../../elevations-get2/1-cor-core2/cor-core2-r1.js ></script>
<script src=../../elevations-get2/3-api-map-api2/api-map-api2-r1.js ></script>
<script src=../../elevations-get2/9-kml-kml2/kml-kml2-r1.js ></script>
<script>

// add user and branch

KML.folders = [
'data-path-csv',
'data-path-kml',
'data-path-tcx',
'test'
];

KML.defaultFolder = 1;

KML.urlAPITreeContents = 'https://api.github.com/repos/jaanga/terrain3/git/trees/gh-pages?recursive=1';

// KML.defaultFile = '../../elevations-data/elevations-data-04/san-francisco_10_163_394_3_3_450_450_.json';
KML.defaultFile; // if no default, select a random file

// KML.extension = '.json';
KML.extension = '.kml';

// KML.searchInFolder = 'elevations-data-04/';
KML.searchInFolder = KML.folders[ KML.defaultFolder ];

// KML.urlBase = '../../';
KML.urlBase = 'https://jaanga.github.io/terrain3/';


init();

function init() {

COR.taglineHeader = 'Select a file!' + b;

COR.initLeftMenu();

COR.menu.innerHTML =

COR.getMenuDetailsHeader() +

API.getMenuDetailsAPIKey() +

KML.getMenuDetailsSelectFile() +

API.getMenuDetailsMapClick() +

COR.getMenuDetailsObjectProperties( COR.defaults ) +

COR.getMenuDetailsTemplate() +

COR.getMenuDetailsAbout() +

COR.getMenuFooter() +

b;

KMLdetailsSelectFile.setAttribute('open', 'open');

APIclickDetails.setAttribute('open', 'open');

if ( window.self !== window.top ) { hamburger.style.left = '0px'; }

KML.getGitHubAPITreeContents();

COR.getPlaceDefaults();

API.onEventAPIKeyUpdate();

}


KML.onLoadJSONFile = function( xhr ) {

COR.getPlaceDefaults();

console.log( 'file loaded', KML.fileName );

API.setCenter( COR.place.latitude, COR.place.longitude, true )

}


</script>
</body>
</html>
Loading

0 comments on commit fbd64b6

Please sign in to comment.