Closed aso2101 closed 7 years ago
Okay, there was a bug in the app:map
in handling single points on a map. This has been fixed so you can replace all calls to app:inscription-map
with app:map
and remove app:inscription-map
from app.xql
. Still need to handle the issues with clashing javascript functions that cause trouble when you attempt to expand/collapse the map.
Great. 0497bef replaces them, but before I get rid of app:inscription-map
, two more map-related requests:
app:inscription-map
automatically centered the map on the (single) marker in the geojson data, whereas app:map
doesn't. Is there a way to have app:map automatically center the map on the marker(s)?map.js
, there is the following bit of code that's supposed to add a link to the map marker on browse.html
(I've changed app.xql
to set the relevant class name to placeName
). But so far I haven't found a way to apply it. Maybe you could try?function addLinksToPlace() {
var spans = document.getElementsByClassName(placeName);
if (typeof spans != 'undefined') {
for (i = 0; i<spans.length; i++) {
var span = spans.item(i);
var a = document.createElement("a");
var b = document.createTextNode(" ");
var linkText = document.createTextNode("(show on map)");
a.appendChild(linkText);
a.href = "javascript:void();";
a.onclick = function() {
map.setView(layer.getLatLng());
layer.openPopup();
location.hash = '#';
};
span.appendChild(b);
span.appendChild(a);
}
}
}
Partially resolved. New branch adds centering and uses 'fitBounds' to fit all markers onto map. Still need to fix the javascript to add links to placeNames.
Just FYI: 72b99c2 addresses two map-related problems, namely
map.js
which caused only one data-point in $data
to loadmap.xql
so that tei:geo
doesn't have to be a direct child of tei:place
(in fact, it's not supposed to be, as i found out!); this should also work for full-TEI place records (I can confirm that it works with Gaṅgaperūru.xml
).Updated map.js to center map on a single or multiple markers. Added script to add 'see on map' links to placeNames that appear on the map, @aso2101 If this works as expected you can close this issue.
perfect! fixed with 2cb89e9.
Installed the latest version. Looks like there may have been some merge issues?
Placement of (show on map)
is incorrect, and the panto() function should also trigger a popup when you click on the (show on map)
Fixed. Changed a line in app.xql to enable the popups to trigger javascript correctly.
I am reopening this issue because of the small outstanding bug we talked about (when closing or opening the map in view.html, there is an error such as "Not found: doc=KanB2-6.xml&&id=" and the page reloads).
Fixed on https://github.com/aso2101/satavahana-inscriptions/tree/issue21 Removed id='content-container' to stop default behaviors for javascript animations, which where overriding bootstrap behaviors. (teiPublisher behaviors were for paging, which is not needed for this app, if paging is needed I suggest using another behavior or custom javascript to hide the map.)
@aso2101 Please review and merge if it looks good.
merged with 4f968c5 (which also incorporates some cleanup in earlier commits). by the way, these changes fix the default teipublisher behaviors for browse back and browse forward, which we don't use.
app:map
is invoked elsewhere on the site, and it's nicer, because it pulls dynamic data from the model and uses a separate function to serialize it into geojson. But there seems to a problem with simply replacingapp:inscription-map
withapp:map
inview.html
: the map doesn't appear (andview.html
still has the annoying paging functions from TEIPublisher that are triggered when the map is expanded or collapsed).