|
POST
|
Did you initialize your Map with the option "slider: false"? This example creates a map with no slider or pan arrows. require([ "esri/map", ... ], function(Map, ... ) { var map = new Map("mapDiv", { slider:false, nav:false }); ... });
... View more
04-23-2014
08:51 AM
|
0
|
0
|
2469
|
|
POST
|
That's a part of the Map class. When you initialize it, you have several slider options to set.
... View more
04-23-2014
07:46 AM
|
0
|
0
|
2469
|
|
POST
|
Take a look at this thread where the original poster had a question on his map that showed features using a dropdown list of choices.
... View more
04-23-2014
07:21 AM
|
1
|
0
|
2868
|
|
POST
|
You can use the debugging tools to see what the values for everything in the bundle is. In Chrome, I used the Create a Map sample, added in the resource bundle, and put in a breakpoint to examine the the bundle. This shows the available values for the draw tool. [ATTACH=CONFIG]33244[/ATTACH]
... View more
04-22-2014
05:42 AM
|
0
|
0
|
2115
|
|
POST
|
This code works and keeps the ability to zoom in and out. Are there other things going on in your code that are causing errors? For example, when I used your code to get the number of cities in each state, I started running into proxy errors (too many city geometries returned, possibly) and other problems. Do you need the geometry returned if you're only doing a count? <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" /> <title>Simple Map</title> <link rel="stylesheet" href="http://js.arcgis.com/3.9/js/esri/css/esri.css"> <style> html, body, #map { height: 100%; width: 100%; margin: 0; padding: 0; } body { background-color: #FFF; overflow: hidden; font-family: "Trebuchet MS"; } </style> <script src="http://js.arcgis.com/3.9/"></script> <script> var map; require(["esri/map", "esri/layers/FeatureLayer", "esri/tasks/query", "esri/tasks/QueryTask", "dojo/on", "dojo/_base/array", "dojo/domReady!"], function (Map, FeatureLayer, Query, QueryTask, on, array) { map = new Map("map", { basemap: "topo", center: [-122.45, 37.75], // longitude, latitude zoom: 7 }); var polygonLayer = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/2", { mode: FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); var pointsLayer = new FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0", { mode: FeatureLayer.MODE_ONDEMAND, outFields: ["*"] }); map.addLayers([polygonLayer, pointsLayer]); on.once(map, "update-end", function () { var query = new Query(); query.where = "STATE_NAME = 'California'"; var queryTask = new QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0"); queryTask.executeForCount(query, function (count) { console.log("California has " + count + " cities"); }); //array.forEach(polygonLayer.graphics, function (feature) { // var name = feature.attributes.STATE_NAME; // var query = new Query(); // var queryTask = new QueryTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer/0"); // query.geometry = feature.geometry // query.returnGeometry = true; // queryTask.executeForCount(query, function (count) { // console.log("Locality " + name + " has " + count + " points"); // }); //}); }); }); </script> </head> <body> <div id="map"></div> </body> </html>
... View more
04-21-2014
06:07 AM
|
0
|
0
|
2038
|
|
POST
|
If you're adding the layers to the map using map.addLayers, then you can use the event "layers-add-result". This event fires after all the layers have been added to the map. You could also still use the "update-end" event, but have it run only a single time. The dojo/on event handler has the once function, which will remove the event listener after running once. require(["dojo/on"], function(on){
on.once(map, "update-end", function(){
// will only fire once...
});
});
... View more
04-21-2014
05:03 AM
|
0
|
0
|
2038
|
|
POST
|
In my application, I added a custom base map to the dropdown list of ArcGIS basemaps with the following code
basemapGallery = new BasemapGallery({
showArcGISBasemaps: true,
map: map
});
var basemaps = [];
var chartsBMLayer = new BasemapLayer({
url: "http://egisws02.nos.noaa.gov/ArcGIS/rest/services/RNC/NOAA_RNC/ImageServer"
});
var chartBaseMap = new Basemap({
layers: [chartsBMLayer],
title: "NOAA Charts",
id: "NOAAChart"
});
basemaps.push(chartBaseMap);
basemapGallery.add(chartBaseMap);
basemapGallery.on("load", function () {
for (i = 0; i < basemapGallery.basemaps.length; i++) {
(function (x) {
registry.byId('basemapMenu').addChild(new MenuItem({
label: basemapGallery.basemaps.title,
onClick: function () {
basemapGallery.select(basemapGallery.basemaps .id);
}
}));
}(i));
}
});
... View more
04-18-2014
06:04 AM
|
0
|
0
|
2664
|
|
POST
|
dgrid is part of the JSAPI since 3.4. For example, on the What's New in 3.9 page Version 3.9 of the ArcGIS API for JavaScript uses Dojo 1.9.1 as well as version 0.3.11 of dgrid, 0.3.5 of put-selector and 0.1.3 of xstyle. You will have to include a link to the dgrid css, as shown in this sample.
<link rel="stylesheet" href="http://js.arcgis.com/3.9/js/dgrid/css/dgrid.css">
... View more
04-17-2014
05:22 AM
|
0
|
0
|
2424
|
|
POST
|
Michael, you should start getting in the habit of marking the threads you start as answered. You have quite a few posts with many responses but haven't marked any of them as having answered your question. Marking a post as the answer to your question will help others as they search for a solution to similar issues. Please look at this page if you have any questions about that.
... View more
04-15-2014
06:41 AM
|
0
|
0
|
451
|
|
POST
|
Do you mean dojo/_base/Color? I don't think I've seen an esri/Color module. Take a look at What's New in Version 3.9 In addition to continuous color ramps, the esri/Color module was added at this release. It is a convenient wrapper around dojo/_base/Color and has all options supported by dojo/_base/Color.
... View more
04-11-2014
12:27 PM
|
0
|
0
|
1063
|
|
POST
|
Do you have a proxy set up? In the code there is this line: urlUtils.addProxyRule({
proxyUrl: "/proxy",
urlPrefix: "earthquake.usgs.gov"
});
... View more
04-11-2014
10:24 AM
|
0
|
0
|
1197
|
|
POST
|
There was also discussion of an Esri JavaSCript Optimizer at the 2014 Dev Summit, but the website (http://jso.arcgis.com) currently is redirected to the JavaScript home page.
... View more
04-10-2014
06:23 AM
|
0
|
0
|
1371
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 2 weeks ago | |
| 1 | 02-04-2025 06:39 AM | |
| 1 | 05-01-2026 08:26 AM | |
| 1 | 04-10-2026 12:01 PM | |
| 1 | 04-13-2026 09:11 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|