POST
|
my guess is that you are trying to do the query before the map finishes loading. Try moving your query.execute into a map.on layers-add-result event that is why the alert makes it work. It is basically waiting, giving the map enough time to load Thanks Jeff! on it
... View more
05-01-2014
12:10 PM
|
0
|
0
|
248
|
POST
|
on firebug says error: map.graphics is null still doesn't make any sense
... View more
05-01-2014
11:18 AM
|
0
|
0
|
704
|
POST
|
So the problem with this is error: Cannot read property 'add' of null [ATTACH=CONFIG]33536[/ATTACH] I am not sure what this means... does anyone knows about this?
... View more
05-01-2014
11:13 AM
|
0
|
0
|
704
|
POST
|
here is how it works and problems: url looks like http://my.com/test.htm?bldgabbrv=msc,sup3,gsc,rudd,cen query.where = Abbrev = 'MSC' OR Abbrev = 'SUP3' OR Abbrev = 'GSC' OR Abbrev = 'RUDD' OR Abbrev = 'CEN' then queryTask.execute(query, getLocRes); if you look at getLocRes script stops where map.whatever without them script just goes (tested with bunch of console.log) tried for and while but they were not a problem. The Funny thing is when I add alert(); right before queryTask.execute the function works perfect. Does anyone knows what I did wrong? Thanks! *update on jsfiddle when u click run it should select 4 polygons in maroon color
... View more
05-01-2014
06:56 AM
|
0
|
0
|
704
|
POST
|
Unfortunately, this doesn't help because your application is simply too big for me to spend time digging through. I really need you to strip out all the unnecessary code and create a sample that highlights your specific issue using jsfiddle.net. Sometimes, when doing this, the issue presents itself, so I suggest giving it a try! Sorry and thank you! thanks Jon I'll try to put my code on jsfiddle soon
... View more
04-29-2014
01:54 PM
|
0
|
0
|
704
|
POST
|
Could you recreate the issue using jsfiddle.net so I can take a closer look? Thanks! I tried using jsfiddle but here is url
... View more
04-29-2014
01:39 PM
|
0
|
0
|
704
|
POST
|
You are trying to add an object that does not exist. You want to add 'polyGraphic' to the map.
map.graphics.add(polyGraphic);
Also, make sure you have access to your map object within that functional scope. oops, but anyways that wasn't problem still does same thing and I have full access to the map as well any suggestions? I've tried
function getLocRes(results) {
//map.graphics.clear();
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([80, 0, 0]), 2), new dojo.Color([80, 0, 0, 0.5]));
var combinedExtent = new esri.geometry.Extent();
for (var i = 0;i < results.features.length; i++) {console.log("i=",i);
var polyGraphic = new esri.Graphic(results.features, symbol);
map.graphics.add(polyGraphic);
console.log("i=",i);
}
combinedExtent = esri.graphicsExtent(results.features);
map.setExtent(combinedExtent, true);
}
function getLocRes(results) {
//map.graphics.clear();
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([80, 0, 0]), 2), new dojo.Color([80, 0, 0, 0.5]));
var combinedExtent = new esri.geometry.Extent();
for (var i = 0;i < results.features.length; i++) {console.log("i=",i);
var polyGraphic = results.features;
polyGraphic.setSymbol(symbol);
map.graphics.add(polyGraphic);
console.log("i=",i);
}
combinedExtent = esri.graphicsExtent(results.features);
map.setExtent(combinedExtent, true);
}
both stop at either map.graphics.add(polyGraphic); or map.graphics.clear(); Thanks Jon
... View more
04-29-2014
12:21 PM
|
0
|
0
|
704
|
POST
|
Hi all, function getLocRes(results) {
//map.graphics.clear();
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([80, 0, 0]), 2), new dojo.Color([80, 0, 0, 0.5]));
var combinedExtent = new esri.geometry.Extent();
console.log("er",results.features.length);
for (var i = 0;i < results.features.length; i++) {console.log("i=",i);
var polyGraphic = new esri.Graphic(results.features, symbol);
console.log("i=",polyGraphic);
polyGraphic.setSymbol(symbol);
//map.graphics.add(graphic);
}
combinedExtent = esri.graphicsExtent(results.features);
map.setExtent(combinedExtent, true);
} this function is working sort of but when I enable either map.graphics.clear(); or map.graphics.add(graphic); it stops where the code is console.log("i=",i); this shows only 0 when map.graphics.add(graphic); is on if not it doesn't add graphic but shows console.log("i=",i); result until the end Am I missing something here that map.graphics.add(graphic); shouldn't work? dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.map");
dojo.require("esri.dijit.Popup");
dojo.require("esri.dijit.Legend");
dojo.require("esri.layers.agsdynamic");
dojo.require("esri.layers.ArcGISTiledMapServiceLayer");
dojo.require("dijit.dijit");
dojo.require("esri.tasks.find");//search
dojo.require("esri.arcgis.utils");
dojo.require("esri.dijit.Print");
dojo.require("dojox.grid.DataGrid");
dojo.require("dojo.data.ItemFileReadStore");
dojo.require("dijit.form.Button");
dojo.require("esri.tasks.query");
dojo.require("esri.dijit.Scalebar");
dojo.require("esri.graphic");
dojo.require("esri.symbol");
... View more
04-29-2014
11:20 AM
|
0
|
14
|
6087
|
POST
|
like i said, i wasnt sure if you could union a null extent and a valid extent try calling graphicsUtils.graphicsExtent() on your "res" variable to give you the extent https://developers.arcgis.com/javascript/jsapi/esri.graphicsutils-amd.html#graphicsextent Thanks Jeff, finally made it
... View more
04-29-2014
05:39 AM
|
0
|
0
|
827
|
POST
|
you cant just append a bunch of geometries together and get the combined extent. try (not sure union will work with an inital null extent) function getLocRes(results) {
map.graphics.clear();
var geom;
var combinedExtent = new Extent();
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([80, 0, 0]), 2), new dojo.Color([80, 0, 0, 0.5]));
var res = results.features;
for (var i = 0;i < res.length; i++) {
geom = results.features.geometry.getExtent();
combinedExtent = combinedExtent.union(geom);
var graphic = results.features;
//var graphic = new Graphic(reGeo,symbol);
graphic.setSymbol(symbol);
map.graphics.add(graphic);
}
map.setExtent(combinedExtent , true);
} function getLocRes(results) {
//map.graphics.clear();
var geom;
//
var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([80, 0, 0]), 2), new dojo.Color([80, 0, 0, 0.5]));
var res = results.features;
var combinedExtent = new esri.geometry.Extent();
for (var i = 0;i < res.length; i++) {
geom = results.features.geometry.getExtent();
combinedExtent = combinedExtent.union(geom);
var graphic = results.features;
//var graphic = new Graphic(reGeo,symbol);
graphic.setSymbol(symbol);
map.graphics.add(graphic);
}
var extent = geom.getExtent();
//alert(map.graphics.graphics.length);
map.setExtent(combinedExtent, true);
} [ATTACH=CONFIG]33429[/ATTACH] got an error 😞 that I don't understand :0
... View more
04-28-2014
02:14 PM
|
0
|
0
|
827
|
POST
|
function getLocRes(results) { map.graphics.clear(); var geom; var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([80, 0, 0]), 2), new dojo.Color([80, 0, 0, 0.5])); var res = results.features; for (var i = 0;i < res.length; i++) { geom += results.features.geometry; var graphic = results.features; //var graphic = new Graphic(reGeo,symbol); graphic.setSymbol(symbol); map.graphics.add(graphic); } var extent = geom.getExtent(); map.setExtent(extent, true); } query.where = Abbrev = 'abc' OR Abbrev = 'def' OR Abbrev = 'ghi' selected features are polygons did some stupid thinking like geom += results.features.geometry; but didnt work Can you help me with this? Thank you for your time
... View more
04-28-2014
01:25 PM
|
0
|
8
|
1032
|
POST
|
Thanks Jake, but I need both tiled map and Esri base map together.
... View more
03-04-2014
07:26 AM
|
0
|
0
|
369
|
POST
|
Thanks Manish I've tried esri.layers.ArcGISTiledMapServiceLayer but didn't work and I created jsfiddle http://jsfiddle.net/#&togetherjs=ffG4or9nTV
... View more
03-03-2014
11:47 AM
|
0
|
0
|
369
|
POST
|
Hi all, function init() {
var initExtent = new esri.geometry.Extent({"xmin":1076363,"ymin":3109863,"xmax":1084228,"ymax":3113690,"spatialReference":{"wkid":32139}});
var popup = new esri.dijit.Popup({
fillSymbol: new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255,0,0]), 2), new dojo.Color([255,255,0,0.25]))
}, dojo.create("div"));
center = [-90.3378, 39.6177];
zoom = 14;
map = new esri.Map("map",{
basemap: "topo",
infoWindow:popup,
center: center,
zoom: zoom,
sliderStyle: "large"
});
dojo.connect(grid, "onRowClick", onRowClickHandler);
var basemap = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_OnlineMap_Topo/MapServer");
var imageParameters = new esri.layers.ImageParameters();
imageParameters.layerIds = [0,1,2,3,4,6,8];
imageParameters.layerOption = esri.layers.ImageParameters.LAYER_OPTION_HIDE;
Vlayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_MapInfo/MapServer", {"imageParameters":imageParameters});
map.addLayers([basemap,Vlayer]); where var basemap= I added var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://localhost:6080/arcgis/rest/services/bt/beta_OnlineMap_Topo/MapServer"); but entire map didn't work what did I do wrong? dojo.require("esri.layers.TiledMapServiceLayer"); is in the code as well
... View more
02-28-2014
03:45 PM
|
0
|
5
|
2956
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|