Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps Polylines Overlapping Dilemma

Just wondering if anyone has any input on this situation. I am trying to put a part of a website together using google maps v3 that allows different (we'll call them Routes for simplicity) Routes that show different things on the map. These routes will often follow the same roads for a little while, and then split off and do their own thing.

My question is, do you guys have any feedback as to the best way to make it so that I can see all of the routes colors that overlap?

My thoughts were:

Dotted lines when they overlap: Couldn't figure out how to make the lines dotted...not to mention, what if there were 3 routes that overlapped? Would it then have to have wider dots so that you could see them all?

Side By Side: Seems like the only real way to do it (hoping that I am wrong) but, the issue is that when you zoom out, one route will always overlap the other.

One wider than the other: This just seems like a round-about way, and also looks weird when they arent overlapped..because you have one really fat route and another skinny one or two...

Any thoughts or feedback would be great!

Thanks in advance.

like image 766
user644767 Avatar asked Mar 04 '11 13:03

user644767


1 Answers

If you know, or can detect, which segements of the routes overlap, could you draw the overlapped section once - and as a dotted line?

In order to help the user visualise the entirety of a single route, you could detect when the user's mouse is hovering over a solid section of a route, and then make the whole route solid.

Not sure about the possibility of implementing these ideas in the Google Maps API (as I haven't looked at then for a long time) but they might give you something to think about. In fact, this is similar to how the 'alternative routes' feature on maps.google.com

If you goto this example, there are a couple of suggested routes on the left hand side - hovering your mouse over either of them will amend the way that the route is displayed.

like image 53
belugabob Avatar answered Oct 19 '22 11:10

belugabob