geojs icon indicating copy to clipboard operation
geojs copied to clipboard

Virtual DOM API

Open waxlamp opened this issue 10 years ago • 2 comments

The idea is to emulate DOM for the GL layer.

Basically, on certain mouse events (mouseover etc.) the system could manufacture a DOM element to hang DOM-based features on (e.g., Bootstrap popovers). The config for this behavior could include such things as

  • shape of the DOM element (probably just an SVG circle by default)
  • radius
  • lifetime (which could be similar to bootstrap popovers' show, hide, and delay properties http://getbootstrap.com/javascript/#popovers-usage)

This would be a very general way to bridge JavaScript features over into the GL layer. Performance plus fanciness :raised_hand::collision:

waxlamp avatar Dec 09 '14 16:12 waxlamp

this is an interesting idea. Are you thinking that the DOM element would be for each mark (where mark is a circle)?

aashish24 avatar Dec 10 '14 17:12 aashish24

Something like that. To avoid performance/memory issues, these DOM elements could/should be transient. I thought of this because I recently adapted the Tangelo Flickr demo to use GeoJS, and I was prevented from using a GL feature layer (which I wanted because I could then increase the amount of data I handle) because I wanted to keep my Bootstrap popovers in the demo. I imagined an API for the GL feature layer that would abstractly present me with a DOM element on, e.g., mouseover, that I could then use to hang a popover on. This seems better than replicating every DOM-enabled feature on the GL side as demand for them appears, which is a task of Sisyphean proportions.

waxlamp avatar Dec 10 '14 18:12 waxlamp