xml and infoWindow help

538
6
Jump to solution
01-26-2012 10:45 PM
sherlytobias
New Contributor
i have an xml file containing information about specific latitudes and longitudes. is it possible to make an infoWindow using this xml file? if yes, how?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
IvanBespalov
Occasional Contributor III
sherlyann23,

1 - parse XML - as a result "x" and "y" values (one pair if point, more paths if line or area) and some attributes
( com.esri.viewer.utils.GeoRSSUtil in ArcGIS Flex Viewer source code - u can get some ideas how to parse xml )

2 - create geometry based on "x" and "y" values (1)

3 - create graphic based on geometry (2) and attributes (1)

4 - add graphic (3) to your graphicslayer

5 - show info window

Most of Classes has links to usage examples.

Esri Flex Samples catalog - here.

View solution in original post

0 Kudos
6 Replies
IvanBespalov
Occasional Contributor III
sherlyann23,

1 - parse XML - as a result "x" and "y" values (one pair if point, more paths if line or area) and some attributes
( com.esri.viewer.utils.GeoRSSUtil in ArcGIS Flex Viewer source code - u can get some ideas how to parse xml )

2 - create geometry based on "x" and "y" values (1)

3 - create graphic based on geometry (2) and attributes (1)

4 - add graphic (3) to your graphicslayer

5 - show info window

Most of Classes has links to usage examples.

Esri Flex Samples catalog - here.
0 Kudos
sherlytobias
New Contributor
Thanks for answering! But can i use WebMercatorMapPoint instead of mapPoint so that I can use my latitudes and longitudes? I don't know how to convert lat and lon to x and y values. I'm very new to this.
0 Kudos
IvanBespalov
Occasional Contributor III
sherlyann23,

All "very new" to this starts with reading documentation, look to samples provided by ESRI developers, use this forum search.

Try to use GeometryService to project geometries. Take a look to live samples of this service usage.
This resource provides the service description associated with a geometry service and is primarily a processing and algorithmic resource that supports operations related to geometries.
0 Kudos
sherlytobias
New Contributor
I've been reading documentations and sample source codes but i'm still not sure what exactly i should do. Sir, the instructions you gave me does it give me a result that looks like this one? http://geochalkboard.wordpress.com/2009/03/30/reading-xml-files-with-the-google-maps-api/
Hoping for your answer. Thanks!
0 Kudos
IvanBespalov
Occasional Contributor III
instructions you gave me does it give me a result that looks like this one ...


I tried to show where to find answers to your questions - that's all.

Do you want to copy/paste some code? - I'll stand on the sidelines.
Do you have plan to develop? You do not like the implementation of the code proposed by other developers. You have some part of own code to show, with better solution - Let's discuss it.

Did you see this sample?
http://help.arcgis.com/en/webapi/flex/samples/01nq/01nq00000026000000.htm - load/read/parse XML - implemented, show basic information on map - implemented (click to points on map shows InfoWindow).

P.S. If you think you have not found an answer to your question, may be you need to write more detailed description of your problem.
0 Kudos
sherlytobias
New Contributor
Yes sir I saw that example but its kinda confusing. 😞
I am making a flex mobile application, and I have an xml file and it has 300 entries like this one:
<entry> 
  <id>#_2</id>
  <name>Chalet Oberbort</name>
  <type>Chalet</type>
  <condition>For Rent</condition>
  <region>Gstaad</region>
</entry>
<entry>
  <point>46.424827 7.322059</point>
  <id>#_3</id>
  <name>Chalet Gr�?¼nb�?¼hl</name>
  <type>Chalet</type>
  <condition>For Rent or Sale</condition>
  <region>Lauenen</region>
</entry>...
what i need to do is, to access that xml file and use the tag <point> for the mapPoint and the other tags for information that will be displayed in an infoWindow.
As much as possible, i want a simple code to do this but the samples and documentations that I read was very long and confusing. Please help me sir. 😞 Thanks for your time!
0 Kudos