POST
|
We have several map services with layers (created from SQL Server tables/views) that display datetime fields. We also have HTML popups defined for many of them (table of visible fields). The default format for date fields appears to be "M/dd/yyyy h:mm:ss tt", but I would like to change it to "yyyy-MM-dd HH:mm:ss". Is there a way to define a default format on the server, so that it will apply to all date fields? Or is there a way to specify the format in the MXD using ArcMap? Things I have already tried or thought about: Changed the source query to reformat the fields using FORMAT([MyDatetimeField], N'yyyy-MM-dd HH:mm:ss'). That worked, but changed it to a text field, which had some unintended consequences in client applications, since they provide different options for text vs. date fields. Used the CONVERT function in the SQL query to reformat the field *and* keep it as a SQL datetime type. However, ArcGIS ended up reformatting it. Seems like as long as it's a date field, ArcGIS will change the format to its own default. Changed the datetime display settings on the Windows server using Control Panel. This changed the format within ArcMap but not in the published map service. I thought about formatting the HTML popup using XSLT, and using the format-dateTime function within that. However, it looks like only XSLT 1.0 is supported and the date/time format functions need 2.0. We could put code in the client applications to reformat datetime fields in the popups, but that defeats the purpose of defining the HTML popups on the server. While Googling, I did see some references to Field Configurations and the Production Mapping extension, but I currently don't have access to that. It feel like there should be a simple way to do this, but I'm missing it. Thanks, Mike
... View more
05-22-2018
02:10 PM
|
0
|
1
|
1174
|
POST
|
Ugh! Stupid error on my part. I didn't have "showLabels: true" when creating the map. What I had works now.
... View more
04-04-2017
01:51 PM
|
0
|
0
|
1042
|
POST
|
Hi, adding a KMLLayer to the map doesn't seem to display any labels. (There was a similar question about this, but it is a few years old and never really answered.) Anyway, since KML layers are converted to feature layers, I thought I could set the labeling info on the constituent feature layers by doing something like this: kmlLayer.on("load", function() {
var labelingInfo = [{
"labelExpressionInfo": {
"expression": "$feature.name"
},
"labelPlacement": "below-right"
}];
var layers = kmlLayer.getLayers();
for (var i = 0; i < layers.length; i++) {
if (layer instanceof FeatureLayer) {
layer.setLabelingInfo(labelingInfo);
}
}
});
I don't get any errors if I do this, but I also don't get any labels. Should this work for the feature layers created from a KML layer? If not, is there a correct way to add labels to KML layers? Thanks, Mike
... View more
04-04-2017
10:02 AM
|
0
|
3
|
2299
|
POST
|
Oh,that's true. If your web map is already in ArcGIS Online or Portal for ArcGIS, you can export it in json format. If you want to take a JavaScript map object and convert it to json (to be able to save it to AGOL or Portal), there is currently no way that I know of.
... View more
10-30-2015
11:39 AM
|
0
|
0
|
2954
|
POST
|
As far as I know, there is nothing in v. 3.x of the JavaScript API to generate json for a web map, and it is not a trivial task to do it yourself. It is supposed to be a feature of the 4.0 API, but as of Beta 1, it is not available yet. Also, I suspect the PrintTask is generating an Export Web Map, which is slightly different. According to Esri documentation on the ArcGIS web map format: "The web map and its specification should not be confused with the ExportWebMap specification, which is used by ArcGIS Server when printing maps. Although you may notice similarities in properties, they are two different specifications." Mike
... View more
10-30-2015
11:32 AM
|
1
|
0
|
2954
|
POST
|
We're using Windows authentication, so there is no need to log in. Some people will simply not be authorized to view some of the services, but they should still be able to see the layers for which they do have access. The map viewer in the portal behaves this way, but it seems like createMap is failing when one of the services is unauthorized.
... View more
05-11-2015
02:58 PM
|
0
|
0
|
339
|
POST
|
In our own Portal for ArcGIS, I saved a map that contains multiple layers, including a map service layer with security restrictions. I then shared the map to a group, but some of the people in that group do not have access to the restricted map service. When the map is opened with the viewer in portal, it behaves as expected -- the map displays with all layers, except for the restricted map service layer. However, when the map is loaded in our JavaScript API (v 3.13) app using arcgisUtils.createMap, the map displays with only the basemap layer. Also, the then() function is never called, but no exceptions are thrown. Looking at the web traffic in Fiddler, the web map json returned from the portal is correct, and it contains references to all the layers, including the restricted layer. It looks like the individual layer services are then queried, and the restricted service returns a 403 status (as expected). I tried to recreate the scenario using ArcGIS Online. I uploaded a KMZ file, created a map, added the KMZ file to the map (along with other layers hosted on AGOL), and shared the map with everyone (but not the KMZ file). http://www.arcgis.com/home/webmap/viewer.html?webmap=3bef75e7c0644ad88c6d979d9c1da394 It behaves the same way in the online viewer, but it successfully loads (minus the unshared KMZ file) in our JavaScript app as well. I'm not sure why this example would work, other than it is a slightly different scenario -- a KMZ file hosted within AGOL, rather than an external map service. Anyway, the first scenario seems like a bug in the createMap API call. Can anyone confirm this? Thanks, Mike
... View more
05-11-2015
12:25 PM
|
0
|
3
|
4046
|
POST
|
Thanks Mark, Yes, we noticed that the image service worked. We also have an internal version that we maintain, so we have a few options for now. We're also getting the same error on an internal map service, so I'm guessing it's the same issue. Will there be a beta release of the next version of AGX so we can test out some of these issues, along with our custom add-ins? Mike
... View more
12-23-2014
06:58 AM
|
0
|
0
|
319
|
POST
|
OK, thanks. Do you know if they will modify ArcGIS Online to enable 2500 to work until the next version is released? If not, we will probably end up adding the default basemaps to our custom basemap gallery, since we use an ncfg file to configure AGX for our users.
... View more
12-23-2014
06:52 AM
|
0
|
0
|
375
|
POST
|
Hi, the following NOAA map service for their seamless nautical charts will not load in AGX. (I'm using the non-REST URL in AGX.) http://seamlessrnc.nauticalcharts.noaa.gov/arcgis/rest/services/RNC/NOAA_RNC/MapServer If you try to add RNC/NOAA_RNC via Add Content/GIS Services, an error message is displayed: I don't think there is anything inherently wrong with the service, since I can load it in our Silverlight viewer, and I can add it to a map in ArcGIS Online. I don't see any HTTP errors when looking at Fiddler. Any ideas what could be wrong or how to debug this? Thanks, Mike
... View more
12-22-2014
01:09 PM
|
0
|
2
|
3156
|
POST
|
The default basemaps for ArcGIS Explorer Desktop (build 2500) do not display in the gallery. From this post, it sounds like some change was made to ArcGIS Online that prevented them from loading before. Has it happened again? The workaround from before still works -- set your Region to "World" in your ArcGIS Online profile, and then sign in to ArcGIS Online within AGX. Thanks, Mike
... View more
12-22-2014
11:16 AM
|
0
|
2
|
3348
|
POST
|
Hi Riyas, I think that will work. I say "think", because there are some security issues on our server (unrelated to the JavaScript API) that are preventing it from actually downloading the KML. However, looking at it in Fiddler, it *is* accessing the KML service on our server now, instead of the default ESRI service. Thanks for your help! Mike
... View more
08-27-2014
12:12 PM
|
1
|
0
|
814
|
POST
|
The KML URL is irrelevant. I want to change the URL for the KML service that converts the KML into features. When you create a KML layer, the KML URL is passed to the service, which then downloads and parses the KML, converts it into features, and returns a JSON string to the client. By default, it uses the ESRI service at http://utility.arcgis.com/sharing/kml, but I want to know if it's possible to change that and have it use our own. The motivation is that (in theory), our service would be able to handle URLs on our internal servers that the ESRI service cannot access.
... View more
08-27-2014
08:18 AM
|
0
|
2
|
814
|
POST
|
Hi Riyas, Thanks for the reply. I am loading the KML layer as in the example you cited. However, I want to change the KML service that is used to convert the KML into features. The example is just using the default service, and I haven't found a way to change it. Mike
... View more
08-27-2014
06:56 AM
|
0
|
4
|
814
|
POST
|
How can you set the service URL for KML layers? The default is http://utility.arcgis.com/sharing/kml, but I want to have it use our local Portal for ArcGIS (i.e. https://myserver/arcgis/sharing/kml). The Flex API had a serviceURL property in the KML layer class: https://developers.arcgis.com/flex/api-reference/com/esri/ags/layers/KMLLayer.html#serviceURL However, there is no such property in the JavaScript API. I also looked in esri.config and arcgis.utils, but I don't see any corresponding property in those, either. Thanks, Mike
... View more
08-26-2014
03:21 PM
|
0
|
6
|
4052
|
Title | Kudos | Posted |
---|---|---|
1 | 08-27-2014 12:12 PM | |
1 | 10-30-2015 11:32 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|