Since I am having trouble creating a print template with it's associated legend, I decided to play around with creating my
own form that mimics how I want the template to look. I have my main form which displays the map and let's the user pick which layers are visible. They can then choose to print that map. I then want to send them to my print form which will format the map/legend slightly differently that the display form. I was wondering if it's possible to pass the map object between the two forms.
If this is not possible, then I'll get back to creating a print template. btw, I was successful in creating a print service using the tutorial that RS sent me.
Brain,
I don't see why not just have a global var on the second form and set the map to it from the first form.
How would I do that using JavaScript ?
Sent from my iPhone
Brain,
It would be hard fro me to provide any code as I really am not confident on your workflow and would have to write a lot of code from scratch to demo this.
No worries Robert
Sent from my iPhone
No worries Robert
Sent from my iPhone
You could look at converting the map to JSON using the Print task
arcgis javascript api - export map state as JSON: Web_Map_as_JSON
Then store the JSON in the browsers storage to be later retrieved on the next page.
Drew
Thanks Andrew, I'll have to take a look at that when I get back to the office Monday
Or depending on what you are doing exactly, you could just export the map image from the REST or from a MAP_ONLY Print and then pass the generate URL to the next form.
Andrew,
In the following example from the dojox.storage link you provided, where would the actual map object go ?
dojo.require("dojox.storage");
var storageProvider=null;
dojo.addOnLoad(function(){
dojox.storage.manager.initialize();
storageProvider=dojox.storage.manager.getProvider();
storageProvider.initialize();
var myObject={key1:true};
storageProvider.put("myValue", myObject, function(status, keyName){
alert("value put in "+keyName);
});
});