Update map.js

- Add optimized the marker options to support animated GIFs or PNGs
- Fix if statement