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

Save a `Map` object to a mapfile string #2

Open homme opened 11 years ago

homme commented 11 years ago

Calling the toString() method on Map objects should return the mapfile representation of the object as a string. This is possible in Mapserver 6.4 now that mapserver/mapserver#4563 has been implemented.

Implementing it would involve an #ifdef check on the mapserver version and then wrapping the new msWriteMapToString() mapserver function as a synchronous javascript toString() function. It can be synchronous as no IO is performed on the mapserver side.

szekerest commented 11 years ago

As the final (accepted) solution convertToString has been implemented so I don't think it would interfere with the toString method. Java bindings should be compiled along with mapserver core which would provide the methods to stay in sync.