(XY) Event layer & Popups Issue

2388
8
06-06-2011 11:24 AM
KC
by
Occasional Contributor
I'm finding that when I click on my xy event layer's points, the popup does not appear unless I click on some other layer (with popups enabled) first and then click on my xy event point.  The xy point's information is shown replacing the previously opened popup window - it does not open up at the xy point's location, but where I had clicked earlier.

I tried converting the xy event layer to a shapefile and the issue does not exist then.

Is there a workaround or is this a known bug?

Thank you!
Tags (2)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
Kirstin,

   I sounds like this is associated with a known bug where the geometry of a XY Event layer is not being returned correctly. I don't know any status of this bug though.
0 Kudos
ElizabethLahey
New Contributor
Has anyone heard an update on the status of this? I think I'm having a similar issue.

We have a non-SDE SQL database that stores information on fires in a table that includes XY coordinate info. This data is updated frequently, so I'd like to have a direct link to this database that will show the most current information in my Flex app. Using an OLE DB connection and the Make Query Table tool to generate an OID, I am able to bring the table into ArcMap, create an XY event layer, and successfully publish the .mxd to ArcGIS Server. When I add the service to Flex Viewer the points appear on the map in the correct locations, but the popups all appear at XY 0,0 instead of the location where I see the point. I'm also experiencing the issue described by Kirstin if I click on a popup for a feature from a different layer first.

Exporting the event layer to a feature class in a SDE database resolves the issue, but then I lose the "live" connection to the SQL database that I wanted. I brought my map service into an ArcGIS.com map and popups work okay there - so that has me thinking that my data and service are okay. Just wondering if anyone else has dealt with this or found a workaround for this issue.
0 Kudos
RobertRectenwald
New Contributor
I have a workaround for this issue. I created a custom skin as a copy of the popup skin and in commitProperties function I added the lines:
 geometry = WebMercatorUtil.geographicToWebMercator(graphic.geometry)
 infoWindow.show(geometry as MapPoint);

If you're using the zoom functionality you'll need to convert the point before map.zoom
 mapPoint = WebMercatorUtil.geographicToWebMercator(mapPoint) as MapPoint;
 map.zoom(1 / 16, mapPoint);
0 Kudos
DonCopple
Occasional Contributor III
Can you please elaborate, I am looking for the popup skin in flash builder to empliment your fix, but am not having luck.  So, I need to know where to find the skin so I can make this fix (more steps of where to put the code).  Also does this fix effect the way popups work for other layers.  The project we are building has multiple layers, and popups for many of them.  We have notice the the popup information renders correctly using ArcGIS.Com, but not in Flex.  I think it is a bug in Flex, but need a simple work around.  I am using Version 2.4.  Thanks for the help.
0 Kudos
RobertRectenwald
New Contributor
This is not a simple fix. In the Flex API source code, the skin you're looking for is  "\skins\src\com\esri\ags\skins\PopUpRendererSkin.mxml"

Basically, what I did was modify the viewer source code as follows:
[INDENT]

  • Created src\com\esri\viewer\skins\MyPopUpRendererSkin.mxml as a copy of the Flex API file

  • Added functionality to convert the mapPoint to webMercator to my new skin

  • Added the skin to default.css as a new style

  • Modified mapManager.mxml to add the custom style based on a new popup config element

  • Added <style>MyPopUp</style> to the popup's xml file for the ones that need converted

  • Compiled everything in Flash Builder

[/INDENT]

I've included a zip file with all the changes I described. the mapManager change starts at line 1149.
Hopefully this will help.
0 Kudos
DonCopple
Occasional Contributor III
Thanks for the tip, I'll take a look at it.  Too bad this bug isn't fixed as the points render just fine on the map, just the popups do not work correctly.

Thanks again for the quick reply.
0 Kudos
RobertRectenwald
New Contributor
Can you please elaborate, I am looking for the popup skin in flash builder to empliment your fix, but am not having luck.  So, I need to know where to find the skin so I can make this fix (more steps of where to put the code).  Also does this fix effect the way popups work for other layers.  The project we are building has multiple layers, and popups for many of them.  We have notice the the popup information renders correctly using ArcGIS.Com, but not in Flex.  I think it is a bug in Flex, but need a simple work around.  I am using Version 2.4.  Thanks for the help.


If you look at the JSON objects being passed you'll see that the bug is with ArcGIS server. The server is supposed to re-project the XY point to web mercator but it doesn't. I spent a week analyzing the data flow before I figured it out.
0 Kudos
RobertRectenwald
New Contributor
One other option I forgot to mention.
You can add mercatorX and mercatorY columns to your SQL Server data source. Write a table trigger that update the mercator values when the XY values are changed. Then change your mxd file to use the mercator coordinates instead of your original XY coordinates. The hard part in this solution is finding and implementing the formula for doing the coordinate conversion.
0 Kudos