I’m working on a project that involves overlaying test results at a particular location on a map. The map itself is a paintable canvas, as is each small visualization of the test results. Navigating the map (zoom/pan) and getting test result canvases to move around accordingly was pretty straightforward.
However, I have ~2500 testing locations tracked in the database. (The DB for this application contains info from multiple facilities.)
Populating a list component with identifiers and managing the selection is straightforward, but what’s the most practical way (or is it even possible) to generate a paintable canvas for only the selected locations on command?
Ideally, I’d have a “regen” button that, when clicked, would delete all existing test result canvases, then loop through the selected items from the list component (or some arbitrary query result) and generate a new paintable canvas for each. I’m open to limiting this to 25 canvases at a time (or something reasonable) to curb resources.
Obviously, I’d like to avoid managing a couple thousand individual canvases and their visibility.
Create a customer dataset property on the canvas component for selected tests and selected locations.
When an item is checked from the list, have it modify this dataset.
Your paint script will just loop through both datasets and draw the appropriate items.
[quote=“jpark”]Create a customer dataset property on the canvas component for selected tests and selected locations.
When an item is checked from the list, have it modify this dataset.
Your paint script will just loop through both datasets and draw the appropriate items.[/quote]
Aah, a “one canvas to rule them all” approach, I think I follow you. The # of tests are fixed, so those check boxes could be monitored directly by the map canvas. Give the map canvas a new dataset where each record is a location with columns for top/left map position, testing results, basic identifier.
Based on where a user clicks on the map, I should be able to detect if s/he clicked on a result box and enable the click-through to a detail page. Better yet, I could use the same dataset used by the map canvas to feed the detail page with multiple records.