There is a way to avoid creating and using that file.
Put its contents into the map page itself, as a JavaScript array.
However, one will have to ensure that quotes and apostrophes are properly escaped.
It's possible to improve performance by caching the page and updating it whenever the positions-DB entries change. And a simple way of doing that is to calculate a MD5 or SHA1 hash value for the positions DB whenever it gets updated, and to update the page only when its hash code differs from the DB's one.
PHP has some built-in functions for that, md5() and sha1(), so it should be straightforward to implement.
|