Display Z value  ??

1914
10
04-28-2010 08:44 PM
Divyaprasad
New Contributor II
Hi

In my application I have used sample flex viewer in which the banner used displays the value of X & Y cordinates on mouseMove. Similarly, Is it possible to display even Z value along with (X,Y). how do i get it ? Im new to flex and help is very much needed. Please help.

Diya
Tags (2)
0 Kudos
10 Replies
karldailey
New Contributor
are you talking about the zoom level on the map?  does myMap.scale help?  myMap is the ID of your ESRI map
0 Kudos
Divyaprasad
New Contributor II
are you talking about the zoom level on the map?  does myMap.scale help?  myMap is the ID of your ESRI map


Hey autokad

Thanks for ur reply, but my problem is not wid zoom level. i have my map with DEM data. when i move mouse over map it displays the lat long (X,Y) values. similarly i want to display elevation (Z value) on mouse move..

Im using Sample flex viewer - Banner which displays cordinates - if that helps 

Thanks
0 Kudos
Divyaprasad
New Contributor II
somebody please help..
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Diya87,

      It help to understand how the XY in the Banner is getting there. Basicly when the mouse moves over a Flash Stage the mouse knows its coordinates based on the stage size and values like X: 300 and Y: 126 are returned from the mouse move event, those values are then feed to the map.toMapFromStage function and actual map coordinates are returned. There is not function on the map component that will return Z. As the Flex ArcGIS API is right now and the REST endpoint that Flex consumes there is no Z-Aware capability on a map service. The only way you could possibly get a Z Value from a DEM is to build a geoprocessing task that you could fire on a mouse click. I do not have any examples of how to do this.
0 Kudos
ZahidChaudhry
Occasional Contributor III
I totally agreed with Robert. In my opinion, its not even practical to display z value on mouse move as it will make your application so slow because of server client traffic that its almost useless. The best way, you can engineer (my Personal opinion not an expert advice) is by adding a map click event and where ever you click get the Z value of that point coming from a map service layer which has that value
0 Kudos
Divyaprasad
New Contributor II
Hey Robert & chaudhry1

Thank you so much for your suggestions and explanations. It really helped me in understanding how it works as i ws really wondering as to how to make it possible. Thanks a lot.

But chaudry1 how do i get Z value from map service without using any geoprocessing task?
0 Kudos
ZahidChaudhry
Occasional Contributor III
Easiest way, will be to publish elevation data as a map service and then query it on MapClick event and get z-value. you will use your mapPoint to query your elevation layer..I havent tried this idea yet, but i know its possible as i did something similar before

Thanks

Zahid
0 Kudos
Divyaprasad
New Contributor II
Hey

Thanks Zahid for your reply. ya i had tried similar thing by publishing DEM and retrieving values from that. but i had tried with mouse move. i was wrong. this time ill try with ur idea. Thanks a lot once again Zahid.
0 Kudos