Select to view content in your preferred language

Bug with 'Time' enabled FeatureLayers?

845
5
01-11-2011 04:15 AM
MR
by
Emerging Contributor
I think there maybe a bug with the Javascript API when working with a 'Time' enabled FeatureLayer. Can anyone else confirm?

I have a layer of individual point which originates from a SQL Server database (I used Make Query Table to add the layer to my map). With 'Time' disabled I am able to use the Javascript API and add this layer as a FeatureLayer, I can then add functions like being able to hover over the points to show information etc.

As soon as I enable 'Time' in my MXD, restart the GIS Service and refresh my web application I see nothing but the underlying map. I know the data is being returned from the server because the legend is being written and I am able to print information from individual points as text on the page - I just can't visualise the points!

Any ideas?

Kind regards,

Mark
0 Kudos
5 Replies
KellyHutchins
Esri Frequent Contributor
I have seen similar issues if I have the 'Enable time on map' button on ArcMap's Time Slider window pressed.  The link below is to the server help, can you check your map document in ArcMap and see if the Enable Time on Map button on the Time Slider window is pressed?

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//005z0000000z000000.htm
0 Kudos
MR
by
Emerging Contributor
Thank you for the swift response Kelly - I shall try this when I'm back at work tomorrow and provide an update.

I'll kick myself if it's this simple!
0 Kudos
MR
by
Emerging Contributor
Kelly, no such luck I'm afraid - that had no effect on the map.

Do you have any other thoughts? Happy to provide any additional information if needed but unfortuantely my server is on deployed on a local Intranet so no Internet access.

I'm using ArcGIS Server 10.01 (SP1) if that makes any difference.

Regards,

Mark
0 Kudos
KellyHutchins
Esri Frequent Contributor
Can you post your code? Perhaps there's something in the code that is causing an issue.
0 Kudos
MR
by
Emerging Contributor
Well I took the Huricane Explorer from the API samples (http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/time_snapshot.html) and swapped in my ArcGISTiledMapServiceLayer, FeatureLayer and changed the range of years the timeSlider ranges from. This is the application where I can see that the data is being returned from the server because where it's supposed to show the Active Huricanes I changed "feature.attributes.NAME;" to var hurricaneName = feature.attributes.OBJECTID; to output the object id's from my data.

When this wasn't working I tried a more simple version, code below.
(Please note I hand typed this from one computer to another so there might be the odd typo!)

Regards,

Mark

<!DOCTYPE HTML PUBLIC "-/W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Test</title>
  <link rel="stylesheet" type="text/css" href="http://lord-gis/arcgis_js_api/library/2.1/arcgis/js/dojo/dijit/themes/claro/claro.css">
  <script type="javascript">
   var djConfig = { parseOnLoad: true };
  </script>
  <script type="text/javascript" src="http://http://lord-gis/arcgis_js_api/library/2.1/arcgis">
  </script>
  <script type="text/javascript" language="javascript">
   dojo.require("esri.map");
   dojo.require("esri.layers.FeatureLayer");
 
   function init() {
 
    var map = new esri.Map("map");
    var map basemap = new esri.layers.ArcGISTilesMapServiceLayer("http://lord-gis/ArcGIS/rest/services/LORD/AFG_BaseMapping/MapServer");
    map.addLayer(baseMap);
 
    var timeLayers = [];
    var iedLayer = new esri.layers.FeatureLayer("http://lord-gis/ArcGIS/rest/services/LORD/TestMap/MapServer/0", {
     mode: esri.layers.FeatureLayer.MODE_SNAPSHOT,
     outFields: ["*"]
    });
    timeLayers.push(iedLayer);
 
    map.addLayers(timeLayers);
   }
 
   dojo.addOnLoad(init);
  </script>
</head>
 
<body class="claro">
  <div id="map" style="width:800px; height:600px;">
  </div>
</body>
</html>
0 Kudos