mpetroff / pannellum

Pannellum is a lightweight, free, and open source panorama viewer for the web.
https://pannellum.org/
MIT License
4.16k stars 712 forks source link

removeHotspotId api, hotspotId, number or string #1088

Closed dbwodlf3 closed 2 years ago

dbwodlf3 commented 2 years ago

https://github.com/mpetroff/pannellum/blob/eb50628da1852afa5a1586f88bcd1e01a3e63468/src/js/pannellum.js#L3207

hotspotId and sceneId can have string or number type. but in the api use "===" exactly equal syntax. if you didn't purpose it, I think it is better to use "==" expression than it.

mpetroff commented 2 years ago

I did it on purpose, since I generally err on the side of strict checking to avoid issues due to type conversion. However, there's no particular need for it in this case, so I relaxed the checks.

The IDs are specified as strings in the documentation, so while numbers may end up working, they're not explicitly supported.