Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapview: Clickable segments/points #228

Closed
jteresco opened this issue Aug 27, 2017 · 7 comments
Closed

Mapview: Clickable segments/points #228

jteresco opened this issue Aug 27, 2017 · 7 comments

Comments

@jteresco
Copy link
Contributor

A possible feature to add: click on any polyline and get an infowindow about that segment, including links to the HB for each route carried by that segment.

@yakra
Copy link
Contributor

yakra commented Aug 27, 2017

Ooh. Yes.

@michihdeu
Copy link
Contributor

I think I like the idea even more than #95. Not just a list of all routes in a defined radius but exactly the route(s) of a segment. I think it's more useful and I guess it should be easier to be implemented. Nevertheless, the other feature might have additional benefit.

@jteresco
Copy link
Contributor Author

This might have become easier with the recent addition of graph edge popups in HDX.

@jteresco
Copy link
Contributor Author

jteresco commented Jul 1, 2019

tmtest version (code in branch polylinepopups for now) shows only route like "NY NY5" or "RI US1BusPro", but the intent is to include all routes carried by the segment, the visible waypoint endpoints of each, an HB link for each, and the segment length. Since the Polylines are stacked on top of each other for concurrent routes, things are more complicated than they'd seem at first.

@yakra
Copy link
Contributor

yakra commented Jul 1, 2019

Would it make sense to add concurrency info to the DB?

@yakra
Copy link
Contributor

yakra commented Jul 1, 2019

In mapview.php, system.php & region.php, clicking an edge will produce a popup where I clicked, but pan to a seemingly random location.

Web/lib/tmjsfuncs.js

Lines 820 to 835 in 7dfd8e3

function connectionClick(arg){
let v1;
let v2;
let i = arg.connIndex;
if (graphEdges.length > 0) {
v1 = waypoints[graphEdges[i].v1];
v2 = waypoints[graphEdges[i].v2];
}
else {
v1 = waypoints[i];
v2 = waypoints[i+1];
}
let midlat = (parseFloat(v1.lat) + parseFloat(v2.lat))/2.0;
let midlon = (parseFloat(v1.lon) + parseFloat(v2.lon))/2.0;
map.panTo([midlat, midlon]);

Do we have the wrong connIndex maybe?


Must be what you mean by

Since the Polylines are stacked on top of each other for concurrent routes, things are more complicated than they'd seem at first.

@jteresco
Copy link
Contributor Author

jteresco commented Jul 5, 2019

This functionality is live on the production site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants