Select to view content in your preferred language

Export Map Widget

2334
37
10-19-2010 06:47 AM
deleted-user-RjoC4IOGTpoH
Deactivated User
Another great widget from Robert which is much appreciated.

I would like to fire off the widget from the toolbar instead of the current lower left position.
I edited the config.xml to place the widget in the toolbar but as expected, when you click on it the widget appears in the lower left and you have to click on it again to run it.

What code changes would be needed to just fire it from the toolbar?

Thanks again Robert.

Nestor.
Tags (2)
0 Kudos
37 Replies
CoryHines
Deactivated User
Not sure if anyone is still following this or not, but here is how to integrate the export map widget into the HeaderControlWidget.

I believe I have everything commented in the code that I changed.  Don't forget to change the actual container code at the bottom.  It is different than the default.  Also, remember to add the elements from the export map xml file into the header xml file.

NOTE: I changed the export interface to a spark label instead of an icon, if you want to keep it as an icon you'll have to change the code toward the bottom to adjust where it shows up.

I have it running on my site.
http://gis.linncounty.org/flexviewer
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Cory,

   You should go grab the latest versions of the eSearch and eDraw widgets from the code gallery I have fixed and improved several things.
0 Kudos
FrankRoberts
Frequent Contributor
Roberts et al.

I'm tweezing apart the exportMap.mxml and wondering about this line of code (I changed map to map2 for discussion):

var map2:Map = ViewerContainer.getInstance().mapManager.map;

It seems as if this line of code should make a copy of the "map" to my new map called "map2".  But in my playing around it seems like if I make changes to the new map2 it then cascades those changes to the original "map".  If I desire to make a unique copy of the map and then tweak it (say changing size, so I can use it to embed in a PDF and have the map take up the right portion of the page), is there a better way to copy the "map" into a stand alone object?

Thanks much,
Frank
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Frank,

   Display objects can only exist in one memory space and/or container at a time so you would have to do a deep clone of all layers and graphics.
0 Kudos
JimLucht
Emerging Contributor
Hi Folks

This is a fantastic widget but I'm running into a problem where it sometimes fails to work. The user clicks on the icon and the save file dialog box never comes up, even after repeated clicking. It might work earlier in the session but then stops working altogether.

One more clue: it seems to work until a popup comes up, either through a searched result or map click. I close the popup and it still fails to export. I'm running the eSearch widget as well.

Has anyone else run into this? It's on v. 2.5 on Chrome (both win and mac). Have not tested on other browsers but I wil.

Many thanks!

Jim
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jim,

   I have never tested on Chrome (don't like it), but you are the first to report any issue with this widget not working.
0 Kudos
JimLucht
Emerging Contributor
Hi Robert

Thanks for the reply. Well, leave it to me to find (or create) some weird bug. Just checked and it exhibits the same behavior in IE. I'm going to implement it in another viewer to see if I can replicate.

It really seems to only occur if popups are generated, either through the search results or clicking on the map. Hovering over the tool still gives the tip and cursor change, just no action on click.

Anyway, I'll see what more I find out and post. The site is here if you care to look:
http://mapper.provplan.org/flexviewers/parcelmapper2/

Thanks again for all of the excellent code you've posted. It really makes the difference.

Jim
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jim,

   I need to do some testing but the first thing you should try is moving the export button away from the navigation controller. I am able to replicate your issue on your site so I will try and see if I can determine the cause.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jim,

   The popups where definetly the cause in your case as you were displaying a house image and trying to export this popup required a security policy to be loaded for the image and esri does not do that in thier popups. Long story short I have fixed it by forcing the popup closed and clearing it's contents before exporting the map.

Go get the latest version.

Version 2.5.0.1 - Jan 20, 2012

* Added a visual indicator that the tool is working.
* The maps info window is closed automatically and cleared so that there is not a
  sandbox security violation if the popup has an image in it.
0 Kudos
JimLucht
Emerging Contributor
Wow, thanks! I will try the new code right away.

I think placing the export map button in a different place is a very good idea. On a lower resolution monitor/small window things shrink up pretty radically and the navigation really obscures the button.

I really appreciate your help.

Thanks again,

Jim
0 Kudos