Select to view content in your preferred language

Drawing on a Map

1344
7
07-01-2010 09:34 AM
TonyCollins
Regular Contributor
Hi there,

I need to provide a map marking up facility in our mapping browser (9.3 and API2.0).
Obviously this is not too complicated from within the API using the Draw tool, but I am farming out printing to a .NET service I have written so I can print to scale.

Can anyone suggest something for this scenario? I was thinking of generating the image in .NET and reading back into the Flex app to perform some marking up, but then this is an image and not a map so I won't be able to use the draw tool??

Thanks for any direction
Tony
Tags (2)
0 Kudos
7 Replies
Drew
by
Frequent Contributor
Tony,
Are you saying you want to draw the graphics from the flex map onto a print your generate from a .NET web service?

Drew
0 Kudos
TonyCollins
Regular Contributor
Hi Drew,

Well I demoed the new system yesterday which went very well I have to say, but a very common request from most users was marking up the map with labels and points etc.

Now I know this is simple within FLEX using the drawTool from the API, but this does not help me as my prints requests are farmed out to .NET so I can print to scale.

So really I just want some advice or direction on how I can achieve this??

Thanks for any Help
Tony

Tony,
Are you saying you want to draw the graphics from the flex map onto a print your generate from a .NET web service?

Drew
0 Kudos
Drew
by
Frequent Contributor
Well If you are saying you want the custom drawings on the prints you generate using .NET you will have to send the geometry and symbology back to the server and redraw them on your server side map.
This will be easier said than done, but here are some steps�?�

�?� Use the Flex API to allow the user to draw on the map.
�?� When the user wants to print you will have to convert the custom drawings to a object to send with your .NET web service. This object will have to include the geometry and symbology of the markup(s). I would keep it simple at first.
�?� On the server side (assuming you have all the geometry and the symbology) you will have to redraw the users markup on the map so it gets embedded into the file you return.

I hope I am understanding your question correctly.. please let me know if I am not.

Drew
0 Kudos
TonyCollins
Regular Contributor
Thanks for your reply Drew,

So I would actually do the drawing in .NET onto another image and then merge it with the layer images?

If so I'm not to sure about getting the geometry into pixel locations on the image?

Thanks again for you help!


Well If you are saying you want the custom drawings on the prints you generate using .NET you will have to send the geometry and symbology back to the server and redraw them on your server side map.
This will be easier said than done, but here are some steps�?�

�?� Use the Flex API to allow the user to draw on the map.
�?� When the user wants to print you will have to convert the custom drawings to a object to send with your .NET web service. This object will have to include the geometry and symbology of the markup(s). I would keep it simple at first.
�?� On the server side (assuming you have all the geometry and the symbology) you will have to redraw the users markup on the map so it gets embedded into the file you return.

I hope I am understanding your question correctly.. please let me know if I am not.

Drew
0 Kudos
Drew
by
Frequent Contributor
Well..are you drawing the map on the .NET side also or just sending back  the map URL to your web service?
0 Kudos
TonyCollins
Regular Contributor
Hi, I am calling the export service for each map-service and then merging all the rendered images into one image (all in .NET).

I understand I could send over all the graphics geometries with this call to .NET, but I am just not sure how I would use this geometry to position the shapes I will be drawing on the rendered map image. Do I need to delve into the world of Arc Objects (not done this before) to make these translations to pixel coords?

Hope I am explaining this right and thanks for your help!
Tony


Well..are you drawing the map on the .NET side also or just sending back  the map URL to your web service?
0 Kudos
Drew
by
Frequent Contributor
Here is how I would do it�?�

�?� I would create a .NET web service that accepted an extent as a parameter
�?� Using the ArcGIS SOAP API I would then generate a map with the extent that was passed in.
o More on SOAP API here: http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/ArcGIS/SOAP/overview.htm
�?� Then export the map as a PNG �?�

Once you get that far try modifying your web service to accept geometry and symbology.. This will be the hard part, but as mentioned before keep it simple.
�?� Once you have a good representation of the geometry (in xy coordinates) on the .NET side add the graphics to the map
o You can find samples here:  http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/ArcGIS/SOAP/map_overview.htm
o Then try exporting your map image (using the SOAP API still)  as a PNG


This is not the easiest thing to explain without major code samples and I am sorry but I don�??t have them.

If you wanted to get this done quick and dirty you can just use the Flex Screen Capture functionality to get an image but it won�??t be the correct width and height.. it will be just what the user sees. See more on this here:
http://blog.empiregpservices.com/post.cfm/flex-capturing-a-screen-shot-and-download-it-example
0 Kudos