Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow instantiation of Map instances from javascript object mapfile representations #3

Open
homme opened this issue Mar 18, 2013 · 0 comments

Comments

@homme
Copy link
Member

homme commented Mar 18, 2013

Mapfiles can be represented very effectively as JSON structures: most mapfile directives would map over to object properties. Those directives that would not do so are ones like LAYER and CLASS which would instead map over to arrays of objects, following the underlying mapserver C data structure.

Defining such a JSON structure would be very useful in the context of declarative mapping as it allows easy manipulation of the mapfile parameters from plain javascript code: the mapfile object representation could be created and modified at will and then used to instantiate a Map object using an asynchronous FromJSON() class method.

Although strictly speaking the argument to FromJSON() would be a native javascript object literal the name underlies the intent.

Implementation would involve a synchronous serialising object/function that returns a mapfile string: this string would then be used to instantiate the object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant