POST
|
I'm reordering some layers map.reorderLayer(id,index); and that's working flawlessly, but I'd like to query against the map object to review the layer order. I see in this method that there is an index associated with the layer id, which leads me to believe I can determine the order of the layers at anytime. Question: Is there a method to determine a particular layer's order or a property in the map object I could use? Thanks,
... View more
06-05-2014
08:04 AM
|
0
|
1
|
1881
|
POST
|
I've experienced BING tiles loading in slowly and in further inspecting the source on bing maps I discovered that Microsoft is calling a dynamic service and we, via esri, are calling a tiled service. Is there a plan to integrate Microsoft's Dynamic service into the ESRI JS API? thanks
... View more
03-27-2014
05:06 AM
|
0
|
0
|
543
|
POST
|
Thanks for this thread, I was able to create an ideal dynamic layer legend solution beautifully from your snippets, this was the perfect nudge I needed. :cool:
... View more
11-20-2013
12:31 PM
|
0
|
0
|
1382
|
POST
|
is it possible to make 'esri.request' non asynchronous?
... View more
11-20-2013
03:41 AM
|
0
|
0
|
511
|
POST
|
Hey I got it working, but haven't looked at it in a while, here's what I created.
jen = {};
function ajaxAdd(opt) {
jen.ajaxData = {};
$.ajax({
url: opt.url,
type: 'GET',
dataType: 'json',
error: function() {
console.error('Ajax Load error');
},
success: function(data) {
console.info('ajax is successfull');
jen.graphicObj = {};
jen.graphicObj.Layer = new esri.layers.GraphicsLayer();
for (var i = 0; i < (data.length); i++) {
jen.ajaxData.points = {
"points": [Number(data.longitude), Number(data.latitude)],
"spatialReference": ({
"wkid": 4326
})
};
jen.graphicObj.geometry = new esri.geometry.Point(data.longitude, data.latitude);
jen.graphicObj.infoTemplate = new esri.InfoTemplate("Attributes:", "<tr>Loco Number: <td> " + data.number + "</tr></td><br><tr>Longitude: <td>" + data.longitude + "</tr></td><br><tr>Latitude: <td>" + data.latitude + "</tr></td><br><tr>Minutes Idle: <td>" + data.idelTimeMinutes + "</tr></td>");
jen.graphicObj.graphic = new esri.Graphic(jen.graphicObj.geometry, jen.circle, '', jen.graphicObj.infoTemplate);
jen.graphicObj.Layer.add(jen.graphicObj.graphic);
}
}
}).done(function(){
//build the layer once the call is created
}); //end of ajax call
}
jen.graphicObj.Layer.setRenderer(jen.rendererCircle);
This dumps everything into an object. loop through the object and you'll be able to add the layer to the map. Let me know if you have some more questions. Sorry if its too vague I ended up adding this to a bigger code base I've been building
... View more
09-25-2013
12:01 PM
|
0
|
0
|
421
|
POST
|
in the non-amd iteration of the API there was a 'lods' method that could be used to set the level of displays of the map to allow the map to be zoomed in closer than the basemap allows. I don't see this in the new documentation. Has this been deprecated? if so what's the new way to set the LOD or allow the map to zoom in closer than the basemap allows? thx
... View more
09-17-2013
08:36 AM
|
0
|
1
|
365
|
POST
|
I'm creating graphics layer with ajax return. I can see the graphics layer in the map, but the points don't appear on the layer, I'm adding the points but somehow something seems missing. Jen is an object that's holding most of the map elements. EDIT: I'm now getting a new error here's the reformated code: **Error: Problem parsing d="Z"**
$.ajax({
url: opt.url,
type: 'GET',
dataType: 'json',
error: function(error) {
console.error('error: ' + error);
jen.ajaxData.points = {
"points": [
[-122.63, 45.51],
[-122.56, 45.51],
[-122.56, 45.55],
[-122.62, 45.00],
[-122.59, 45.53]
],
"spatialReference": ({
"wkid": 4326
})
};
},
success: function(data) {
console.info('ajax is successfull');
jen.graphicObj = {};
jen.graphicObj.Layer = new esri.layers.GraphicsLayer();
for (var i = 0; i < (data.length); i++) {
jen.ajaxData.long.push(data.latitude);
jen.ajaxData.lat.push(data.longitude);
jen.ajaxData.num.push(data.number);
jen.ajaxData.idleTime.push(data.idelTimeMinutes);
jen.ajaxData.points = {
"points": [jen.ajaxData.long, jen.ajaxData.lat],
"spatialReference": ({
"wkid": 4326
})
};
jen.graphicObj.geometry = new esri.geometry.Multipoint(jen.ajaxData.points);
jen.graphicObj.infoTemplate = new esri.InfoTemplate(//);
jen.graphicObj.graphic = new esri.Graphic(jen.graphicObj.webMercator, jen.circle, '', jen.graphicObj.infoTemplate);
jen.graphicObj.webMercator = esri.geometry.geographicToWebMercator(jen.graphicObj.geometry);
jen.graphicObj.Layer.add(jen.graphicObj.graphic);
}
} //end of success function
}).done(function(){
//layers get added in a loop after this point
}
... View more
08-16-2013
03:47 AM
|
0
|
3
|
988
|
POST
|
whenever I'm instantiating a new Navigation object I'm getting an error: Cannot read property 'query' of null upon inspection of the objects everything looks correct but it fails every time. Has anyone else experienced this? I'm using ArcGIS js version 3.6 Here's my instantiation call: require(['esri/map', 'esri/layers/ArcGISTiledMapServiceLayer', 'esri/layers/ArcGISDynamicMapServiceLayer', 'esri/symbols/PictureMarkerSymbol', 'esri/renderers/SimpleRenderer', 'esri/toolbars/navigation', 'esri/dijit/Scalebar'], function(Map, ArcGISTiledMapServiceLayer, Navigation, Scalebar) { nsmap.map = new Map(mapID, { basemap: 'gray', //valid options: "streets" , "satellite" , "hybrid", "topo", "gray", "osm" center: [-84.858, 37.388], zoom: initLevel, lods: lod, slider: false }); nsmap.nav = new Navigation(nsmap.map); }); Thanks
... View more
08-11-2013
09:37 AM
|
0
|
1
|
834
|
POST
|
I've been having a tough time getting the renderer to work with my dynamic services all internal but ending with: '/MapServer/0'. My map is built on a series of loops and callbacks, everything is working except for trying to show a dynamic layer with the esri renderer. Does anything look wrong here? I've thrown everything in an object to ensure nothing is getting overwritten during execution. Thanks,
var setDynamicLayer = function(URL, img, lyrNm, mxSc) {
lyrHldr.push(new esri.layers.ArcGISDynamicMapServiceLayer(URL, {
id: lyrNm
}));
var Ren = {};
Ren.defaultSym = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 30,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([100,149,237]), 1),
new dojo.Color([224,255,255,0.75]));
Ren.renderer = new esri.renderer.SimpleRenderer(Ren.defaultSym);
Ren.options = [], Ren.drawingOptions = new esri.layers.LayerDrawingOptions();
Ren.drawingOptions.renderer = Ren.renderer;
Ren.options.push(Ren.drawingOptions);
_.last(lyrHldr).setLayerDrawingOptions(Ren.options);
return _.last(lyrHldr);
};
... View more
07-25-2013
02:02 PM
|
0
|
0
|
770
|
POST
|
Has any created a function to adjust the identify parameter's identify tolerance(screen pixels) per the map scale or zoom level? If no function can this be confirmed that ESRI is or is not already making this adjustment? Thanks
... View more
07-15-2013
12:12 PM
|
0
|
0
|
1900
|
POST
|
Thanks Ken. I ended up solving this by creating an object literal, but I'm going to dig through your code, I like your organization and display method on the map.
... View more
07-15-2013
12:09 PM
|
0
|
0
|
254
|
POST
|
I'm running a loop based on the currently visible layers to run an identify function for multiple layers simultaneously. The identify task is working but I can't seem to get the deferred portion right. I tried a .then vs addCallback but the return never updates the deferred object that the call is completed. Any insight would be great. idParams.geometry = evt.mapPoint; idParams.mapExtent = map.extent; var feature, lyrIdent = []; for (var j = 0; j < ident.length; j++) { if(ident .url != "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer"){ deferred = ident[1].execute(idParams); } deferred.then(function(response){ return dojo.map(response, function(response){ var feature = response.feature; lyrIdent.push(feature.attributes); var template = new esri.InfoTemplate("#"); feature.setInfoTemplate(template); return feature; }); }); } map.infoWindow.setFeatures([ deferred ]); map.infoWindow.show(evt.mapPoint); console.log(lyrIdent); }
... View more
07-12-2013
11:10 AM
|
0
|
3
|
932
|
POST
|
You helped get me to the place I needed. I'm using Jquery heavily these days and your dynamic add of the checkbox was exactly what I was missing. I added a jquery button dynamically and the problem was solved in minutes. The dynamic layer adding is beautiful and makes app maintenance so much better. Thanks a lot
... View more
06-13-2013
05:18 AM
|
0
|
0
|
321
|
POST
|
Ben, I love what you've created, and yes that' exactly what i'm going for. I'll dig through your code a bit more to work on implementing it vs what I have. So my problem lies in not being able to manipulate the layer after its created (dynamically). You may have solved this in your code based on how your creating each layer. I'll have a go with this and get back to you, your seperate config.js sheet is a cleaner way for app maintenance which is the ultimate goal of my app as well. This is the click function that I'm using to look through the layers and toggle visibility(main goal). I find it a bit quicker to create an array and manipulate it during layer resume/suspend and use that for referencing if the layer is in the map vs calling the esri method. var setChkBox = function(lyr, layerName) {
"use strict";
if(lyrIDs.indexOf(lyr) > 1) {
layerName.suspend();
lyrIDs.splice(lyrIDs.indexOf(lyr), 1);
} else if (!(lyrIDs.hasOwnProperty(lyr))) {
lyrIDs.push(lyr);
layerName.resume();
}
};
... View more
06-12-2013
09:36 AM
|
0
|
0
|
321
|
Title | Kudos | Posted |
---|---|---|
1 | 01-11-2013 11:09 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|