|
POST
|
In the code you just posted, you left out some key characters in a URL path: <script src="https://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script>
... View more
12-10-2013
11:42 AM
|
0
|
0
|
2823
|
|
POST
|
Have you also added in the reference to ESRI.CSS? [HTML]<link rel="stylesheet" href="http://js.arcgis.com/3.7/js/esri/css/esri.css">[/HTML] It's also required.
... View more
12-10-2013
10:57 AM
|
0
|
0
|
2823
|
|
POST
|
If they both "work" then that would lead me to believe that ESRI's dojo CSS styling is overwriting what's found in the default CSS dojo styling that comes when using the googleapi. I guess one way to verify this is examine the CSS properties of the same dojo pane in your googleapi dojo version and the ESRI hosted dojo version. In Firebug or Chrome's web developer tool, you should not only be able to see what CSS properties are being applied to the element, but also what styles would have applied to the element if they weren't being overridden. The CSS properties that are being overridden are usually shown with a strikethrough font style in the inspector. Another possibility is that the Dojo found in the googleapi path is more current than the Dojo that's bundled with v3.7 of the API. I get the sense that v3.8 is due to be released "soon" so you may also try updating your reference to that once it gets released and see if that solves your problem. Giood luck! Steve
... View more
12-10-2013
09:46 AM
|
0
|
0
|
2823
|
|
POST
|
This may not be ideal but how about creating four map divs (one for each ArcGIS Online webmap) and then use CSS or the esri.show() / esri.hide() methods to manage which web map is visible? You'll have to sync the map extents, of course, but that can be done using the extent-change event.
... View more
12-06-2013
08:43 AM
|
0
|
0
|
1540
|
|
POST
|
Good catch, Michael, thanks. Won't help you with MapImageLayers but I guess there is an option under the right circumstances.
... View more
12-05-2013
02:17 PM
|
0
|
0
|
4498
|
|
POST
|
I hope someone else can prove me wrong but I believe that this cannot be done using just the API. I really would like to add this to one of my applications but have yet to accomplish this. There might be, however, one way to do this but it's likely to be slow and clunky: publish a geoprocessing (GP) service to perform this task. In ArcToolbox, there is a "Get Cell Value" tool. You can find it under Data Management->Raster->Raster Properties. You could publish this tool as a GP and then pass it your coordinates (taken from the onClick event of the raster or more likely the map) and then present the results back to your user. I played briefly with this but wasn't successful but this was because the raster I wanted to query was a geo-registered image which has no projection information (I added it to my map as a MapImageLayer). I got bogged down in a two step process of trying to project the image first and then sending that result (along with my x,y) to the Get Cell Value tool. I've talked with the devs at the ESRI UC about this and they seemed surprised that raster layers didn't have an identify function. I'm hoping it gets added eventually but for now, I think the GP route may be your only option. Steve
... View more
12-05-2013
09:04 AM
|
0
|
0
|
4498
|
|
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
|
2293
|
|
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
|
1145
|
|
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
|
1737
|
|
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
|
1737
|
|
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
|
1663
|
|
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
|
771
|
|
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
|
666
|
|
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
|
1382
|
|
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
|
3761
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Friday | |
| 1 | Thursday | |
| 1 | Thursday | |
| 1 | Thursday | |
| 1 | Wednesday |