loyaltyRanges seem to be working; ready for data
This commit is contained in:
+58
-35
@@ -1,36 +1,59 @@
|
|||||||
key,latitude,longitude,
|
key,latitude,longitude
|
||||||
Jeor_Mormont-1,76.17449795,-99.53613281,
|
Jeor_Mormont-1,76.17449795,-99.53613281
|
||||||
Jeor_Mormont-1,74.36667479,-96.87011719,
|
Jeor_Mormont-1,74.36667479,-96.87011719
|
||||||
Jeor_Mormont-1,74.62510096,-125.0830078,
|
Jeor_Mormont-1,74.62510096,-125.0830078
|
||||||
Jeor_Mormont-1,76.36226182,-117.6855469,
|
Jeor_Mormont-1,76.36226182,-117.6855469
|
||||||
Jeor_Mormont-1,76.59854507,-112.3828125,
|
Jeor_Mormont-1,76.59854507,-112.3828125
|
||||||
Robert_Baratheon-1,74.36667479,-96.87011719,
|
Robert_Baratheon-1,74.36667479,-96.87011719
|
||||||
Robert_Baratheon-1,74.62510096,-125.0830078,
|
Robert_Baratheon-1,74.62510096,-125.0830078
|
||||||
Robert_Baratheon-1,74.05579888,-140.2880859,
|
Robert_Baratheon-1,74.05579888,-140.2880859
|
||||||
Robert_Baratheon-1,71.20191973,-153.8232422,
|
Robert_Baratheon-1,71.20191973,-153.8232422
|
||||||
Robert_Baratheon-1,64.86760782,-151.7138672,
|
Robert_Baratheon-1,64.86760782,-151.7138672
|
||||||
Robert_Baratheon-1,65.92855384,-158.1298828,
|
Robert_Baratheon-1,65.92855384,-158.1298828
|
||||||
Robert_Baratheon-1,59.73425345,-162.3486328,
|
Robert_Baratheon-1,59.73425345,-162.3486328
|
||||||
Robert_Baratheon-1,53.8784404,-153.4716797,
|
Robert_Baratheon-1,53.8784404,-153.4716797
|
||||||
Robert_Baratheon-1,46.34692761,-161.0302734,
|
Robert_Baratheon-1,46.34692761,-161.0302734
|
||||||
Robert_Baratheon-1,43.61221677,-158.1298828,
|
Robert_Baratheon-1,43.61221677,-158.1298828
|
||||||
Robert_Baratheon-1,45.61403741,-144.5947266,
|
Robert_Baratheon-1,45.61403741,-144.5947266
|
||||||
Robert_Baratheon-1,40.68063803,-136.3330078,
|
Robert_Baratheon-1,40.68063803,-136.3330078
|
||||||
Robert_Baratheon-1,43.73935208,-119.8974609,
|
Robert_Baratheon-1,38.3072,-133.96
|
||||||
Robert_Baratheon-1,53.8784404,-113.3056641,
|
Robert_Baratheon-1,35.9958,-139.058
|
||||||
Robert_Baratheon-1,50.81981826,-111.1962891,
|
Robert_Baratheon-1,32.6579,-137.563
|
||||||
Robert_Baratheon-1,52.24125615,-100.1220703,
|
Robert_Baratheon-1,35.066,-130.62
|
||||||
Robert_Baratheon-1,58.28639548,-96.60644531,
|
Robert_Baratheon-1,31.4662,-129.038
|
||||||
Robert_Baratheon-1,57.35023748,-84.47753906,
|
Robert_Baratheon-1,27.5667,-134.136
|
||||||
Robert_Baratheon-1,59.62332522,-90.234375,
|
Robert_Baratheon-1,16.9307,-136.421
|
||||||
Robert_Baratheon-1,65.71255746,-93.88183594,
|
Robert_Baratheon-1,11.1353,-135.718
|
||||||
Robert_Baratheon-1,67.50856836,-82.98339844,
|
Robert_Baratheon-1,6.27162,-125.435
|
||||||
Robert_Baratheon-1,71.34301347,-80.30273438,
|
Robert_Baratheon-1,2.24064,-112.119
|
||||||
Robert_Baratheon-1,72.90672343,-82.58789063,
|
Robert_Baratheon-1,13.6246,-108.955
|
||||||
Robert_Baratheon-1,76.47577254,-78.046875,
|
Robert_Baratheon-1,17.7696,-100.693
|
||||||
Robert_Baratheon-1,77.76758238,-80.94726563,
|
Robert_Baratheon-1,19.0206,-101.748
|
||||||
Robert_Baratheon-1,78.59529919,-88.06640625,
|
Robert_Baratheon-1,20.3858,-92.5635
|
||||||
Robert_Baratheon-1,77.7861905,-91.66992188,
|
Robert_Baratheon-1,30.1071,-78.5889
|
||||||
Robert_Baratheon-1,75.58493741,-90.43945313,
|
Robert_Baratheon-1,32.5468,-77.8418
|
||||||
Robert_Baratheon-1,74.18805166,-87.01171875,
|
Robert_Baratheon-1,32.6949,-87.2021
|
||||||
|
Robert_Baratheon-1,36.3859,-80.5225
|
||||||
|
Robert_Baratheon-1,43.3571,-80.7422
|
||||||
|
Robert_Baratheon-1,48.9225,-83.335
|
||||||
|
Robert_Baratheon-1,49.6392,-106.7139
|
||||||
|
Robert_Baratheon-1,48.3416,-110.5371
|
||||||
|
Robert_Baratheon-1,43.0368,-117.7
|
||||||
|
Robert_Baratheon-1,43.73935208,-119.8974609
|
||||||
|
Robert_Baratheon-1,53.8784404,-113.3056641
|
||||||
|
Robert_Baratheon-1,50.81981826,-111.1962891
|
||||||
|
Robert_Baratheon-1,52.24125615,-100.1220703
|
||||||
|
Robert_Baratheon-1,58.28639548,-96.60644531
|
||||||
|
Robert_Baratheon-1,57.35023748,-84.47753906
|
||||||
|
Robert_Baratheon-1,59.62332522,-90.234375
|
||||||
|
Robert_Baratheon-1,65.71255746,-93.88183594
|
||||||
|
Robert_Baratheon-1,67.50856836,-82.98339844
|
||||||
|
Robert_Baratheon-1,71.34301347,-80.30273438
|
||||||
|
Robert_Baratheon-1,72.90672343,-82.58789063
|
||||||
|
Robert_Baratheon-1,76.47577254,-78.046875
|
||||||
|
Robert_Baratheon-1,77.76758238,-80.94726563
|
||||||
|
Robert_Baratheon-1,78.59529919,-88.06640625
|
||||||
|
Robert_Baratheon-1,77.7861905,-91.66992188
|
||||||
|
Robert_Baratheon-1,75.58493741,-90.43945313
|
||||||
|
Robert_Baratheon-1,74.18805166,-87.01171875
|
||||||
Robert_Baratheon-1,73.35305494,-95.94726563
|
Robert_Baratheon-1,73.35305494,-95.94726563
|
||||||
|
@@ -1,7 +1,8 @@
|
|||||||
key,firstChapter,firstEpisode,
|
key,firstChapter,lastChapter,firstEpisode,lastEpisode
|
||||||
Robert_Baratheon-1,AGOT-1,S1E01,
|
Robert_Baratheon-1,AGOT-1,AGOT-46,S1E01,S1E06
|
||||||
Robert_Baratheon-2,AGOT-10,S1E10,
|
Jeor_Mormont-1,AGOT-1,ASOS-33,S1E01,S3E03
|
||||||
Jeor_Mormont-1,AGOT-1,S1E01,
|
Mance_Rayder-1,AGOT-1,ASOS-72,S1E01,S4E08
|
||||||
Jeor_Mormont-2,AGOT-10,S1E10,
|
Undeclared-1,AGOT-47,,S1E07,
|
||||||
Mance_Rayder-1,AGOT-1,S1E01,
|
Stannis_Baratheon-1,AGOT-47,,S1E07,
|
||||||
Mance_Rayder-3,,AGOT-10,S1E10
|
Joffrey_Baratheon-1,AGOT-47,,S1E07,
|
||||||
|
Renly_Baratheon-1,AGOT-47,,S1E07,
|
||||||
|
+25
-2
@@ -60,6 +60,16 @@
|
|||||||
idKey="'key'">
|
idKey="'key'">
|
||||||
</ui-gmap-polygons>
|
</ui-gmap-polygons>
|
||||||
|
|
||||||
|
<!-- Loyalty Range Polygons -->
|
||||||
|
<ui-gmap-polygons
|
||||||
|
models="mapModels.loyaltyRanges"
|
||||||
|
path="'path'"
|
||||||
|
fill="'fill'"
|
||||||
|
stroke="'stroke'"
|
||||||
|
visible="options.politicalAllegiances"
|
||||||
|
idKey="'key'">
|
||||||
|
</ui-gmap-polygons>
|
||||||
|
|
||||||
<!-- Character Markers -->
|
<!-- Character Markers -->
|
||||||
<ui-gmap-markers
|
<ui-gmap-markers
|
||||||
models='mapModels.characters'
|
models='mapModels.characters'
|
||||||
@@ -112,9 +122,9 @@
|
|||||||
<button class="list-group-item btn-clear" ng-click="toState('about')" ng-class="{highlight:(state=='about')}">
|
<button class="list-group-item btn-clear" ng-click="toState('about')" ng-class="{highlight:(state=='about')}">
|
||||||
<i class="glyphicon glyphicon-question-sign"></i>
|
<i class="glyphicon glyphicon-question-sign"></i>
|
||||||
</button>
|
</button>
|
||||||
<!-- <button class="list-group-item btn-clear" ng-click="toState('edit')" ng-class="{highlight:(state=='edit')}">
|
<button class="list-group-item btn-clear" ng-click="toState('edit')" ng-class="{highlight:(state=='edit')}">
|
||||||
<i class="glyphicon glyphicon-pencil"></i>
|
<i class="glyphicon glyphicon-pencil"></i>
|
||||||
</button> -->
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -357,6 +367,19 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="point in clickHistory">
|
||||||
|
<!-- <td></td>
|
||||||
|
<td></td> -->
|
||||||
|
<td>{{point.latitude | number:4}}</td>
|
||||||
|
<td>{{point.longitude | number:4}}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+18
-4
@@ -14,7 +14,7 @@ angular.module('quartermaester')
|
|||||||
characterPaths: true,
|
characterPaths: true,
|
||||||
houseHeraldry: false,
|
houseHeraldry: false,
|
||||||
geographicRegions: false,
|
geographicRegions: false,
|
||||||
politicalAllegiances: false,
|
politicalAllegiances: true,
|
||||||
characters: {}
|
characters: {}
|
||||||
};
|
};
|
||||||
$scope.map = {
|
$scope.map = {
|
||||||
@@ -49,6 +49,7 @@ angular.module('quartermaester')
|
|||||||
$scope.episodes = [];
|
$scope.episodes = [];
|
||||||
$scope.chapters = [];
|
$scope.chapters = [];
|
||||||
$scope.searchResults = [];
|
$scope.searchResults = [];
|
||||||
|
$scope.clickHistory = [];
|
||||||
$scope.toState = toState;
|
$scope.toState = toState;
|
||||||
$scope.slideTo = slideTo;
|
$scope.slideTo = slideTo;
|
||||||
$scope.panTo = panTo;
|
$scope.panTo = panTo;
|
||||||
@@ -97,7 +98,10 @@ angular.module('quartermaester')
|
|||||||
path.editable = true;
|
path.editable = true;
|
||||||
return path;
|
return path;
|
||||||
});
|
});
|
||||||
// console.log("mapModels.paths", foo, $scope.mapModels.paths);
|
|
||||||
|
$scope.mapModels.loyaltyRanges = $filter('qmSlider')(qmData.loyaltyRanges, $scope.slider);
|
||||||
|
console.log("mapModels.loyaltyRanges", $scope.mapModels.loyaltyRanges);
|
||||||
|
//console.log("mapModels.regions", $scope.mapModels.regions);
|
||||||
}
|
}
|
||||||
|
|
||||||
function panToCharacter(newValue, oldValue) {
|
function panToCharacter(newValue, oldValue) {
|
||||||
@@ -280,9 +284,19 @@ angular.module('quartermaester')
|
|||||||
function mapClick(a, b, c, d) {
|
function mapClick(a, b, c, d) {
|
||||||
$scope.state = "slider";
|
$scope.state = "slider";
|
||||||
//console.log(a, b, c, d);
|
//console.log(a, b, c, d);
|
||||||
// console.log(c[0].latLng.lat());
|
//console.log("lng", c[0].latLng.lng());
|
||||||
//$scope.lastClick = JSON;
|
//$scope.lastClick = JSON;
|
||||||
console.log($scope.mapModels.paths);
|
//console.log($scope.mapModels.paths);
|
||||||
|
addClickToEditor(c[0].latLng.lat(), c[0].latLng.lng())
|
||||||
|
}
|
||||||
|
|
||||||
|
function addClickToEditor(latitude, longitude) {
|
||||||
|
$scope.clickHistory.push({
|
||||||
|
latitude: latitude,
|
||||||
|
longitude: longitude
|
||||||
|
});
|
||||||
|
//console.log("history", $scope.clickHistory);
|
||||||
|
//$scope.$apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMapLoad(maps) {
|
function onMapLoad(maps) {
|
||||||
|
|||||||
+37
-1
@@ -69,17 +69,20 @@ angular.module('quartermaester')
|
|||||||
getFile('houses.csv'),
|
getFile('houses.csv'),
|
||||||
getFile('characters.csv'),
|
getFile('characters.csv'),
|
||||||
getFile('regions.csv'),
|
getFile('regions.csv'),
|
||||||
|
getFile('loyaltyRanges.csv'),
|
||||||
getFile('towns.csv'),
|
getFile('towns.csv'),
|
||||||
getFile('borders.csv'),
|
getFile('borders.csv'),
|
||||||
|
getFile('loyaltyRangeEdges.csv'),
|
||||||
getFile('stops.csv'),
|
getFile('stops.csv'),
|
||||||
getFile('waypoints.csv'),
|
getFile('waypoints.csv'),
|
||||||
getFile('paths.csv')
|
getFile('paths.csv')
|
||||||
]).spread(parseData);
|
]).spread(parseData);
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseData(books, chapters, seasons, episodes, houses, characters, regions, towns, borders, stops, waypoints, paths) {
|
function parseData(books, chapters, seasons, episodes, houses, characters, regions, loyaltyRanges, towns, borders, loyaltyRangeEdges, stops, waypoints, paths) {
|
||||||
var qmData = {
|
var qmData = {
|
||||||
borderArrays: {},
|
borderArrays: {},
|
||||||
|
lrEdgeArrays: {},
|
||||||
waypointArrays: {},
|
waypointArrays: {},
|
||||||
bookLookup: {}
|
bookLookup: {}
|
||||||
};
|
};
|
||||||
@@ -91,6 +94,17 @@ angular.module('quartermaester')
|
|||||||
qmData.borderArrays[borders[i].name].push(borders[i]);
|
qmData.borderArrays[borders[i].name].push(borders[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (var i=0; i<loyaltyRangeEdges.length; i++) {
|
||||||
|
if (!(loyaltyRangeEdges[i].key in qmData.lrEdgeArrays))
|
||||||
|
qmData.lrEdgeArrays[loyaltyRangeEdges[i].key] = [];
|
||||||
|
qmData.lrEdgeArrays[loyaltyRangeEdges[i].key].push(loyaltyRangeEdges[i]);
|
||||||
|
// qmData.lrEdgeArrays[loyaltyRangeEdges[i].key].push({
|
||||||
|
// latitude: parseFloat(loyaltyRangeEdges[i].latitude),
|
||||||
|
// longitude: parseFloat(loyaltyRangeEdges[i].longitude)
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
//console.log("qmData.lrEdgeArrays", qmData.lrEdgeArrays);
|
||||||
|
|
||||||
for (var i=0; i<waypoints.length; i++) {
|
for (var i=0; i<waypoints.length; i++) {
|
||||||
if (!(waypoints[i].key in qmData.waypointArrays))
|
if (!(waypoints[i].key in qmData.waypointArrays))
|
||||||
qmData.waypointArrays[waypoints[i].key] = [];
|
qmData.waypointArrays[waypoints[i].key] = [];
|
||||||
@@ -106,6 +120,7 @@ angular.module('quartermaester')
|
|||||||
qmData.books = books;
|
qmData.books = books;
|
||||||
qmData.regions = regions.map(regionModel);
|
qmData.regions = regions.map(regionModel);
|
||||||
qmData.characters = characters.map(characterModel);
|
qmData.characters = characters.map(characterModel);
|
||||||
|
qmData.loyaltyRanges = loyaltyRanges.map(loyaltyRangeModel);
|
||||||
qmData.towns = getTownMarkers(towns, houses);
|
qmData.towns = getTownMarkers(towns, houses);
|
||||||
qmData.heraldry = houses.map(heraldryMarkerModel);
|
qmData.heraldry = houses.map(heraldryMarkerModel);
|
||||||
qmData.characterMarkers = stops.map(characterMarkerModel);
|
qmData.characterMarkers = stops.map(characterMarkerModel);
|
||||||
@@ -321,6 +336,27 @@ angular.module('quartermaester')
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loyaltyRangeModel(loyaltyRange) {
|
||||||
|
var matchingCharacter = {color: "#eeeeee"};
|
||||||
|
console.log(loyaltyRange);
|
||||||
|
var keyMatch = /(.+)\-\d+$/.exec(loyaltyRange.key);
|
||||||
|
if (keyMatch[1]!="Undeclared") matchingCharacter = $filter('filter')(qmData.characters, {key: keyMatch[1]})[0];
|
||||||
|
|
||||||
|
return {
|
||||||
|
key: loyaltyRange.key,
|
||||||
|
fill: {
|
||||||
|
color: matchingCharacter.color,
|
||||||
|
opacity: 0.5
|
||||||
|
},
|
||||||
|
stroke: {weight: 0},
|
||||||
|
path: qmData.lrEdgeArrays[loyaltyRange.key],
|
||||||
|
timing: {
|
||||||
|
episodes: [getEpisodeId(loyaltyRange.firstEpisode), getEpisodeId(loyaltyRange.lastEpisode)],
|
||||||
|
chapters: [getChapterId(loyaltyRange.firstChapter), getChapterId(loyaltyRange.lastChapter)]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
function characterMarkerModel(stop, index, fullArray) {
|
function characterMarkerModel(stop, index, fullArray) {
|
||||||
var matchingCharacter = $filter('filter')(qmData.characters, {key: stop.character})[0];
|
var matchingCharacter = $filter('filter')(qmData.characters, {key: stop.character})[0];
|
||||||
var coords = (stop.town=="") ? {latitude:parseFloat(stop.latitude), longitude:parseFloat(stop.longitude)} : $filter('filter')(qmData.towns, {key: stop.town})[0].coords;
|
var coords = (stop.town=="") ? {latitude:parseFloat(stop.latitude), longitude:parseFloat(stop.longitude)} : $filter('filter')(qmData.towns, {key: stop.town})[0].coords;
|
||||||
|
|||||||
Reference in New Issue
Block a user