themustafaomar / jsvectormap

A lightweight JavaScript library for creating interactive maps and pretty data visualization.
https://jvm-docs.vercel.app
MIT License
365 stars 77 forks source link

Stacked coords not displaying #159

Open The-DesertRat opened 5 days ago

The-DesertRat commented 5 days ago

Hi, I have a use case where I have multiple different tour itineraries, which somtimes re-visit the same cities multiple times.

Currently everything works perfectly, but is it possible to show multiple entries for the same coord?

For example, I have the following markers (I am only showing the relevant entries): - { name: "3. London - Paris Theatre", coords: [51.48933, -0.14406] }, { name: "6. London - Imperial College", coords: [51.48933, -0.14406] }, { name: "12. London - Imperial College", coords: [51.48933, -0.14406] },

In addition I have the following animated lines: - { from: "3. London - Paris Theatre", to: "6. London - Imperial College", style: { stroke: '#e68a00', } }, { from: "6. London - Imperial College", to: "7. London - Imperial College", style: { stroke: '#e68a00', } }, { from: "12. London - Imperial College", to: "8. Leeds - Town Hall", style: { stroke: '#e68a00', } },

At the moment, when you hover over London, you just see the last entry: -

  1. London - Imperial College

I would love to see them listed one after the other when hovering over the single marker: -

  1. London - Paris Theatre
  2. London - Imperial College
  3. London - Imperial College

Is there a way to currently implement this? Or is this something you would consider adding?

Love the project and thank you for all your hard work.

The-DesertRat commented 3 days ago

Regarding the above report, I have a programmatical work around.

I am now creating the full itinerary list in code and inserting it as the last marker for the city using the 'onMarkerTooltipShow’.

This way I can also use the ‘onMarkerClick’ to launch a corresponding form which loads the itinerary for that city.

Thank you again for this project.