|
POST
|
Be sure to test your date formatting in the browsers or devices you anticipate supporting with your application. For whatever reason, date formatting is not consistent across browsers. I've had a date format that works fine in Firefox but return 'NaN' in IE or Chrome. If you do find that you're having problems, consider using a library such as DateJS.
... View more
12-03-2013
06:09 AM
|
0
|
0
|
2233
|
|
POST
|
It's definitely CSS related. I played around with it in Firefox & Firebox and was finally able to get things lined up by making two CSS changes. First, you need to remove the following styling from the Jquery Mobile CSS: [HTML].ui-checkbox input { left: 20px; margin: -5px 0 0; }[/HTML] Lastly, ADD the following CSS into your agsjs.css file: [HTML].agsTOCRootLayerLabel { margin-left: 25px; }[/HTML] That should get things looking more normal. Good luck! Steve
... View more
11-26-2013
08:19 AM
|
1
|
0
|
1111
|
|
POST
|
Unfortunately, someone from ESRI will have to chime in about this. The only KML files I have personally dealt with using the JS API have been VERY small (< 100kb).
... View more
11-22-2013
05:50 AM
|
0
|
0
|
1700
|
|
POST
|
I don't know specifically about KMLs & the JS API but here's a link to the limitations of using KMLs with Arcgis.com: KML Limitations Perhaps these limitations also apply to KML layers within the API..
... View more
11-21-2013
12:43 PM
|
2
|
0
|
1700
|
|
POST
|
It's possible you just haven't used the correct layer type (BasemapLayer). My organization doesn't have it's own basemap developed yet so we're just using the ESRI basemaps. Here, however, is some example code that I used in a mobile version of one of my apps where I only wanted the user to choose between the ESRI streets or Satellite basemaps: function createBasemapGallery(){
var basemaps = [];
var streetMap = new esri.dijit.Basemap({
layers: [new esri.dijit.BasemapLayer({
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
})],
id: "StreetMap",
title: "Street Map View"
});
basemaps.push(streetMap);
var satelliteMap = new esri.dijit.Basemap({
layers: [new esri.dijit.BasemapLayer({
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
})],
id: "Satellite",
title: "Satellite View"
});
basemaps.push(satelliteMap);
basemapGallery = new esri.dijit.BasemapGallery({
showArcGISBasemaps: false,
basemaps: basemaps,
map: map
});
} The basemap is switched using a button toggle whose onClick event code is simply: basemapGallery.select('StreetMap'); Maybe you can add your own basemap using your basemap's URL in place of one in my code example? Good luck! Steve
... View more
11-21-2013
06:13 AM
|
0
|
0
|
1619
|
|
POST
|
In order to display it as a date string (instead of the Epoch numbers you are currently seeing), you will need to add a formatter function to your data grid for your date field. On the HTML side, add the formatter option on the appropriate line of the table headers like this: [HTML] <table dojotype="dojox.grid.DataGrid" jsid="grid" id="grid" selectionMode="none"> <thead> <tr> <th field="OBJECTID" width="0%">OBJECTID</th> <th field="rdName" width="100%">rdName</th> <th field="dateCl" formatter="formatGridDate" width="0%">dateCL</th> <th field="dateOp" width="0%">dateOp</th> </tr> </thead> </table>[/HTML] Next, in JS, you create your formatting function something like this: function formatGridDate(theDate, rowIndex) { var rowdata = this.grid.getItem(rowIndex); var theDate = new Date(parseInt(rowdata.<your date filed name here>)); theDateString = dojo.date.locale.format(theDate, { selector: 'date', datePattern: 'MM/dd/yyyy' }); return theDateString; } You can refer to the Dojo documentation about this here. Good luck! Steve
... View more
11-07-2013
12:35 PM
|
0
|
0
|
751
|
|
POST
|
Sounds to me like you're getting your date returned back to you in Epoch format. All you need to do is convert that date to a date string format and you're done. Beware, though- date formatting is one of the sticky wickets of the javaScript world. I have found that date formatting that works in Firefox may NOT work in IE or Chrome so you will definitely need to test your dates in any browsers you anticipate needing to support. Dojo has its own internal date formatting functions but I've started using a library called date.js which seems to work well across IE, Chrome, and Firefox. Steve
... View more
11-04-2013
09:48 AM
|
0
|
0
|
643
|
|
POST
|
I'm going to half to tackle this at some point in the near future myself. When I look at the API documentation, it kinda looks like you could just use a bind on the "change" event. So, from Francesco's example, it would be something like- $( "#slider-id" ).bind( "change", function(event, ui) {
featureLayerB.setOpacity(ui.value/100);
}); Steve
... View more
11-01-2013
10:14 AM
|
0
|
0
|
1354
|
|
POST
|
You're on the right track. You would use a query to look for your polygon of interest and then perform the "zoom to" functionality once you have the query results. On the javaScript side, you write a function such as this: function zoomRow(id){
theFeatureLayer.clearSelection();
var query = new esri.tasks.Query();
query.where = "NAME='" + (id).toString() + "'";
query.returnGeometry = true;
theFeatureLayer.queryFeatures(query,function(features){
thePoly = features[0].geometry;
theExtent = thePoly.expand(2); //Zoom out slightly from the polygon's extent
map.setExtent(theExtent);
});
}; And then in your comboBox's HTML, you set up the onChange event to something like this: [HTML]<input id="cboPolygonList" onChange="zoomRow(document.getElementById('cboPolygonList').value);"/>[/HTML] I'm leaving out some details since you didn't provide your code but hopefully you get the idea. Steve
... View more
10-29-2013
10:52 AM
|
0
|
0
|
3706
|
|
POST
|
No worries! I had a little wonkty tidbit in my code since it's also trying to create a unique list for my filteringSelect. Glad you got it squared away!
... View more
10-28-2013
01:28 PM
|
0
|
0
|
3096
|
|
POST
|
I've used a FilteringSelect successfully but my coding is a little different. The javaScript code: //Push the list of road names into the combo box
query = new esri.tasks.Query();
query.where = "1=1";
query.outFields = ["*"];
query.returnGeometry = false;
var queryTask = new esri.tasks.QueryTask(SERVERPATH);
queryTask.execute(query,populateRdNameCbo);
.
.
.
function populateRdNameCbo(results) {
//Populate the dropdown list box with unique values
values = [];
testVals = {};
features = results.features;
dojo.forEach (features, function(feature) {
curName = feature.attributes.FULLNAME;
if (!testVals[curName]) {
testVals[curName] = true;
values.push({"OBJECTID":feature.attributes.OBJECTID,"RDNAME":feature.attributes.FULLNAME});
}
});
dataItems = {
identifier: "OBJECTID",
label: "RDNAME",
items: values
};
theStore = new dojo.data.ItemFileReadStore({data:dataItems});
dijit.byId("cboRdName").set("store", theStore);
} My HTML for the combo box is: [HTML]<input id="cboRdName" dojoType="dijit.form.FilteringSelect" searchAttr="RDNAME" name="WidgetName" pageSize="6" fetchProperties="{sort:[{attribute:'RDNAME', descending:false}]}" placeHolder="Select a road or start typing" onChange="updateCrossStreetList();closureProps['rdName'] = document.getElementById('cboRdName').value;closureProps['status'] ='CLOSED';zoomToRoad()"/>[/HTML] This is using v3.4 of the API. Steve
... View more
10-28-2013
09:07 AM
|
0
|
0
|
3096
|
|
POST
|
Unfortunately I don't have any actual code to share but here's an idea- Query the polygons for the one poly that does intersect your point feature. Take note of the polygon's OBJECTID Select all polygons using a "1=1" query. Construct an array of OBJECTIDs for all polygons. Remove the OBJECTID from the array for the polygon that did overlap the point feature Reselect the polygons based on the array of OBJECTIDs That should get you what you want. I think. 😄 [EDIT: this might make it easier. Once you have the overlapping polygon's OBJECTID, re-query the polygons for "OBJECTID <> (overlapping polygon OBJECTID)"] Steve
... View more
10-28-2013
07:19 AM
|
0
|
0
|
925
|
|
POST
|
I have no idea but I wonder if this is at all related to a mobile-centric issue that Derek provides a workaround in this thread. Seems like a quick & easy thing to try! Steve
... View more
10-22-2013
01:46 PM
|
0
|
0
|
2289
|
|
POST
|
Your code looks like mine (I borrowed from a sample as well) but maybe you're trying to combine too many things together in your route symbol setup? My (legacy) code is something like this: function showRoute(solveResult) {
routeSymbol = new esri.symbol.SimpleLineSymbol().setColor(new dojo.Color([255,0,0,0.8])).setWidth(4);
theRoute = solveResult.routeResults[0].route;
theRoute.setSymbol(routeSymbol);
map.graphics.add(theRoute);
Only big difference I see is that you combined a few lines of code into your mapMain.graphics.Add() line of code. Steve
... View more
10-14-2013
01:41 PM
|
0
|
0
|
1529
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a week ago | |
| 2 | a week ago | |
| 2 | 05-21-2026 01:51 PM | |
| 1 | 03-12-2026 01:43 PM | |
| 1 | 03-12-2026 08:41 AM |