|
POST
|
Can you post your code or put some of it into a Fiddle to replicate the error?
... View more
07-17-2013
10:40 AM
|
0
|
0
|
3220
|
|
POST
|
Have you tried setting the layerInfos property on the TOC control? This is how I'm using it (also using the 3.5 AMD syntax)
layerDynamic = new esri.layers.ArcGISDynamicMapServiceLayer(myurl, {
id: 'Dynamic'
});
map.addLayers([layerDynamic]);
map.on("layers-add-result", function (event) {
try {
var toc = new agsjs.dijit.TOC({
map: map,
layerInfos: [{
layer: layerDynamic,
title: "Legend",
slider: true
}]
}, 'tocDiv');
toc.startup();
}
catch (e) {
console.log(e.message);
}
mapReady(map);
});
... View more
07-17-2013
07:33 AM
|
0
|
0
|
3220
|
|
POST
|
remove the basemap:"hybrid" line and it no longer works. That is the problem. I dont want to specify an esri basemap. This code gives me the same wkid
require(["esri/map"], function (Map) {
var map;
map = new Map("map", {
autoResize: true,
sliderStyle : "large",
extent: new esri.geometry.Extent({xmin:-9228363.6,ymin:3140074.58,xmax:-9116765.5,ymax:3202141.45,spatialReference:{wkid:102100}})
});
var layerDynamic = new esri.layers.ArcGISDynamicMapServiceLayer("http://egisws02.nos.noaa.gov/ArcGIS/rest/services/biogeo/SEFCRI/MapServer")
map.addLayers([layerDynamic]);
map.on("update-end", function(){
alert(map.spatialReference.wkid);
});
});
... View more
07-16-2013
11:33 AM
|
0
|
0
|
692
|
|
POST
|
When do you call the alert? Using the following code, the alert says 102100. require(["esri/map"], function (Map) {
var map;
map = new Map("map", {
basemap: "hybrid",
autoResize: true,
sliderStyle : "large",
extent: new esri.geometry.Extent({xmin:-9228363.6,ymin:3140074.58,xmax:-9116765.5,ymax:3202141.45,spatialReference:{wkid:102100}})
});
map.on("update-end", function(){
alert(map.spatialReference.wkid);
});
});
... View more
07-16-2013
11:13 AM
|
0
|
0
|
692
|
|
POST
|
I can't take credit for that example. I came across that posted somewhere on here or GIS.StackExchange and kept it as a bookmark. I'm not sure who coded it.
... View more
07-15-2013
12:41 PM
|
0
|
0
|
1212
|
|
POST
|
Take a look at this Fiddle, which returns the results from several different map services.
... View more
07-15-2013
07:44 AM
|
0
|
0
|
1212
|
|
POST
|
Please show the code you're using to put the points on your map.
... View more
07-15-2013
05:35 AM
|
0
|
0
|
2656
|
|
POST
|
The onUpdateEnd event of the map will "fire after layers that are updating their content have completed."
... View more
07-10-2013
12:00 PM
|
0
|
0
|
1127
|
|
POST
|
What are the coordinates that you're putting in? Are they latitude/longitude coordinates or in another projection?
... View more
07-10-2013
11:22 AM
|
0
|
1
|
2656
|
|
POST
|
Here are two samples that show how to add points to a map programmatically https://developers.arcgis.com/en/javascript/jssamples/graphics_svg_path.html https://developers.arcgis.com/en/javascript/jssamples/map_topo_graphics.html
... View more
07-08-2013
07:54 PM
|
0
|
0
|
2656
|
|
POST
|
This is the new URL for it: https://developers.arcgis.com/en/javascript/jssamples/exp_history.html
... View more
07-08-2013
07:29 PM
|
0
|
0
|
1680
|
|
POST
|
It looks like it has difficult with spatial references other than 102100 and 4326. TUsing a map service with another one gives the following message in the console: Map: Geometry (wkid: 4269) cannot be converted to spatial reference of the map (wkid: 102100) What you'll have to do is get the extent of the extent of your dynamic layer and project it into 102100 or 4326 using a geometry service. You can then use the projected geometry to set the map's extent.
... View more
07-03-2013
11:38 AM
|
0
|
0
|
1689
|
|
POST
|
Here's an example of zooming to the extent of a dynamic map service, using AMD code
<!DOCTYPE html>
<html>
<head>
<title>Create a Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9, IE=10">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css">
<style>
html, body, #mapDiv{
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/"></script>
<script>
var map, layerDynamic;
require(["esri/map", "dojo/Deferred", "dojo/domReady!"], function(Map, Deferred) {
map = new Map("mapDiv", {
center: [-56.049, 38.485],
zoom: 3,
basemap: "streets"
});
layerDynamic = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer", {
id: 'Dynamic',
});
map.addLayers([layerDynamic]);
layerDynamic.on("load", function () {
var deferred = new Deferred();
deferred = map.setExtent(layerDynamic.initialExtent, true);
deferred.then(function () {
console.log("Extent set");
});
});
});
</script>
</head>
<body class="claro">
<div id="mapDiv"></div>
</body>
</html>
... View more
07-03-2013
10:15 AM
|
0
|
0
|
1689
|
|
POST
|
Take a look at this Fiddle, which uses the TOC control. The IdentifyTask will only show the layers turned on in the TOC.
... View more
07-03-2013
09:35 AM
|
0
|
0
|
1740
|
|
POST
|
Add the line in red to your executeIdentifyTask. Every time you turn on/off a layer using the TOC control, the visibleLayers property of the layer "lubbock" will change. So every time you click on the map, triggering the executeIdentifyTask event, you'll have to update identifyParams.layerIds
function executeIdentifyTask(evt) {
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
identifyParams.layerIds = lubbock.visibleLayers;
var deferred = identifyTask.execute(identifyParams);
... View more
07-03-2013
06:13 AM
|
0
|
0
|
1740
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 10-11-2023 06:18 AM |
| Online Status |
Offline
|
| Date Last Visited |
11 hours ago
|