add a framework where map data is sent to javascript
make sure that variant is initialized properly and incremented/decremented according to event