Skip to content

Commit

Permalink
Added Other Basemap Style: StraboSpot MyMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonash committed Aug 17, 2018
1 parent 60a2bed commit 8785e52
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
8 changes: 5 additions & 3 deletions www/app/maps/map/map-layer.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,14 @@
switch (layer.source) {
case 'osm':
return new ol.source.OSM({'layer': 'osm'});
case 'strabo_spot_mapbox':
case 'strabo_spot_mapbox':
case 'mapbox_classic':
case 'mapbox_styles':
return new ol.source.XYZ({'url': url + layer.id + layer.tilePath + '?access_token=' + layer.key});
case 'map_warper':
return new ol.source.XYZ({'url': url + layer.id + layer.tilePath});
case 'map_warper':
return new ol.source.XYZ({'url': url + layer.id + layer.tilePath});
case 'strabospot_mymaps':
return new ol.source.XYZ({'url': url + layer.id + layer.tilePath});
default:
return new ol.source.XYZ({'url': ''}); // No basemap layer
}
Expand Down
8 changes: 8 additions & 0 deletions www/app/maps/map/map.factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@
'tilePath': '/{z}/{x}/{y}.png',
'url': ['http://tiles.strabospot.org/v4/'],
'maxZoom': 19 // https://www.mapbox.com/help/define-mapbox-satellite/
},
'strabospot_mymaps': {
'attributions': '<a href="https://www.strabospot.org">StraboSpot Contributed</a>',
'imageType': 'png',
'mime': 'image/png',
'tilePath': '/{z}/{x}/{y}.png',
'url': ['https://strabospot.org/geotiff/tiles/'],
'maxZoom': 25
}
};
return mapProviders[mapSource];
Expand Down
8 changes: 6 additions & 2 deletions www/app/maps/other-maps/other-maps.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
vm.mapSources = [
{'name': 'Mapbox Classic', 'source': 'mapbox_classic', 'idLabel': 'Map Id'},
{'name': 'Mapbox Styles', 'source': 'mapbox_styles', 'idLabel': 'Style URL'},
{'name': 'Map Warper', 'source': 'map_warper', 'idLabel': '5 Digit Map ID'}
{'name': 'Map Warper', 'source': 'map_warper', 'idLabel': '5 Digit Map ID'},
{'name': 'StraboSpot MyMaps', 'source': 'strabospot_mymaps', 'idLabel': 'Strabo Map ID'}
];
vm.modalTitle = '';
vm.openModal = openModal;
Expand Down Expand Up @@ -190,7 +191,7 @@
}

function save() {
if (vm.data.source === 'map_warper' && (!vm.data.title || !vm.data.id )) {
if (( vm.data.source === 'map_warper' || vm.data.source === 'strabospot_mymaps' ) && (!vm.data.title || !vm.data.id )) {
$ionicPopup.alert({
'title': 'Incomplete Map Info!',
'template': 'Title and Map ID required fields.'
Expand Down Expand Up @@ -218,6 +219,9 @@
case 'map_warper':
testUrl = 'https://strabospot.org/map_warper_check/' + vm.data.id;
break;
case 'strabospot_mymaps':
testUrl = 'https://strabospot.org/strabo_mymaps_check/' + vm.data.id;
break;
}
$ionicLoading.show({'template': '<ion-spinner></ion-spinner><br>Testing Connection...'});
testMapConnection(testUrl).then(function () {
Expand Down

0 comments on commit 8785e52

Please sign in to comment.