When a user clicks on a marker how would I present data from the db in a large box in a static location? I would want to keep the popup to present a few fields from the database and have this larger area present the complete data list. This area would need to be updated when another marker is clicked. I'm using carto.js v.4 to build this map.

I've uploaded a jpg screen shot of my current map, adding a mock up of the window I'm hoping to build, circled in red. mock up design of map with data window

I have continued to search through Google and have been unable to find any examples of something like this. I've tried different methods and nothing gets me anywhere close, hence no code snippets to share. My experience is limited enough that I'm not sure if I'm asking the right questions. If someone knows of an example similar to what I'm proposing that would be helpful. I could possibly figure out what to do by examining that.

  • I'm nominating this for reopening, because it's a clear question now. However, questions are expected to show some effort to solve your own issue. You can improve this question further by editing it to include what you've tried so far, where you're stuck and, if applicable, a concise code snippet. – csk Jul 26 '18 at 17:47
  • I have tried using examples from Carto but none that I've tried provide this kind of functionality. I have also done extensive google searching. I found one item that uses lat/long but that seems to be specific functions to that data type. I keep thinking that I could alter the popup function but that seems to use specifics from the carto library that don't seem to do what I'm looking for. Plus I still need the popup as it is currently displayed. – Chris Coffin Jul 26 '18 at 18:20
  • I recommend to keep using the edit button to keep improving your question rather than creating a comment trail. – PolyGeo Jul 26 '18 at 18:35

UPDATE: I revisited the example found at https://carto.com/developers/carto-js/examples/#example-detect-feature-over-out Changed the featureOver to a featureClick, put some unique names to the const and it all seems to be working well. I'm now able to present a brief version of the information from the database in the popup, and a more complete list in a side box. As is so often the case it was a fairly simple solution. Now it's just a matter of styling.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.