ibm-watson-data-lab / cognitive-event-finder

Web-based chatbot for finding events/sessions at conferences
https://cognitive-event-finder.mybluemix.net/
Apache License 2.0
10 stars 0 forks source link

Link from event in chat to map #44

Closed markwatsonatx closed 7 years ago

markwatsonatx commented 7 years ago

In the chat results add links on the events that fly to/center on icon in map.

isc-rsingh commented 7 years ago

I have some code working that does this @markwatsonatx but it doesn't quite seem right unless the popup is also triggered. Centering is easy. Firing the mouse click event properly to get the popup to happen is harder. @ryanbaumann any thoughts?

markwatsonatx commented 7 years ago

@rajrsingh Can you send me that code? I am working on that now. I have the mouse click event firing. I had to change the way we rendered the messages from the server.

ryanbaumann commented 7 years ago

@rajrsingh @markwatsonatx here are the map navigation links to the native maps platform https://github.com/ibm-cds-labs/cognitive-event-finder/blob/master/public/js/eventList.js#L104-L125

I would recommend adding an event listener to text click event from the Watson chat bot. The callback could look like:

function onClickText(map, point, popup) {

    map.flyTo({center: point});

    popup.setLngLat(point)
        .setHTML('this is the popup')
        .addTo(map);
}
markwatsonatx commented 7 years ago

This is in there now. I also added links for recent searches. However, they do not work on mobile. Will investigate if I have time.