geo-data / node-mapserv

All the functionality of Mapserver's `mapserv` CGI program made available to Node.js
BSD 2-Clause "Simplified" License
21 stars 8 forks source link

Allow `Map` instances to be updated from mapfile snippets #4

Open homme opened 11 years ago

homme commented 11 years ago

Although individual mapserv requests can change map file parameters via a form or a URL there is currently no way to permanently update a live Map instance.

To remedy this whilst adhering to the declarative spirit of the module, an asynchronous updateFromString() method would need to be added to the Map class. This would wrap the underlying mapserver msUpdateMapFromURL() function which implements the CGI mapserver functionality described above. As such the function would take two string parameters; the first specifying the object to update using the mapfile object notation and the second specifying the actual mapfile snippet.

As msUpdateMapFromURL() is not thread safe a call to it would need to be wrapped with a parser lock:

msAcquireLock( TLOCK_PARSER );
msUpdateMapFromURL(...);
msReleaseLock( TLOCK_PARSER );