POST
|
I dont think so because u are still going to have the overlaping on the layers. How i told u, the best way to do that is choosing with layer, index what u want to put first and what do u want to put behind.
... View more
10-16-2019
01:43 PM
|
0
|
0
|
861
|
POST
|
Also u can change the visualizacion on the layers , indicating an index on what layer should be first or above. you do this with map.addLayer(layer,index)
... View more
10-16-2019
11:57 AM
|
0
|
0
|
2386
|
POST
|
OH now i know, but thats impossible to do i think , unless u make combinations and save them as combinations. Every layer is going to cover the previous one, thats how it works so far. The only thing u can do in this case it is changing the layer opacity, so in that way you can actually see both... but you will have to deal with opacity for each map that the user selects.
... View more
10-16-2019
11:55 AM
|
0
|
1
|
2386
|
POST
|
I dont understand too much the reason, why do u need to merge all the layers in one? I think in ur case i would make a rest service with all the info that u wanna put there (u actually can put separated layers if u want) and then, programatically, calle them as dynamic service. So in that way you only call "one" layer instead of calling all of them separated.
... View more
10-16-2019
11:04 AM
|
0
|
1
|
2386
|
POST
|
Oh yeah, it was that. Thanks Robert! The final code: <script>
require([
"esri/layers/FeatureLayer",
"esri/geometry/Extent",
"esri/graphicsUtils",
"esri/tasks/query",
"esri/tasks/QueryTask",
"esri/map",
"dojo/dom",
"dojo/parser",
"dojo/ready",
"dojo/on",
"dijit/layout/ContentPane",
"dijit/layout/BorderContainer",
"esri/kernel",
'esri/graphic',
'esri/layers/GraphicsLayer',
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/Color"
], function (
FeatureLayer, Extent, graphicsUtils, Query, QueryTask, Map,
dom, parser, ready, on, ContentPane, BorderContainer, kernel, Graphic, GraphicsLayer, SimpleMarkerSymbol, SimpleLineSymbol, Color
) {
parser.parse();
ready(function(){
var map = new Map("map",{
basemap: "topo",
center:[-71.7018, -33.0228],
zoom:8,
spatialReference: 32719
});
//Load a FeatureTable to the application once map loads
map.on("load", loadData);
var gLayerFind = new GraphicsLayer();
function loadData(){
var l = login(kernel)
.then(resolve=>{
console.log(resolve)
var gLayerMedidor2 = new GraphicsLayer();
var r = Math.floor(Math.random() * 255);
var g = Math.floor(Math.random() * 255);
var b = Math.floor(Math.random() * 255);
var mySymbol = new esri.symbol.SimpleMarkerSymbol(
esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 30,
new esri.symbol.SimpleLineSymbol(
esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new esri.Color([0, 40, 255, 0.9]),
1
),
new esri.Color([255, 51, 255, 0.7])
);
var p = loadPostes(Query,QueryTask, map, resolve[1], ["678742","678743"])
.then(resolve=>{
console.log(resolve,"pipes")
resolve.map((r , index ) =>{
gLayerFind.add(new Graphic(resolve[index].geometry,mySymbol));
});
map.addLayer(gLayerFind,1);
//
// map.graphics.add(new Graphic(featureSet.features[0].geometry, mySymbol));
}).catch(error=>{
console.log(error, "error postes")
})
}).catch(reject=>{
console.log(reject)
})
}
});
});
</script>
var qTaskInterruptions = new QueryTask(layers.pole_layer);
var qInterruptions = new Query();
qInterruptions.returnGeometry = true;
qInterruptions.outFields=["*"];
qInterruptions.where = entregas;
qInterruptions.outSpatialReference = map.spatialReference;
... View more
10-16-2019
07:25 AM
|
0
|
0
|
673
|
POST
|
I changed my code to this one: <script>
require([
"esri/layers/FeatureLayer",
"esri/geometry/Extent",
"esri/graphicsUtils",
"esri/tasks/query",
"esri/tasks/QueryTask",
"esri/map",
"dojo/dom",
"dojo/parser",
"dojo/ready",
"dojo/on",
"dijit/layout/ContentPane",
"dijit/layout/BorderContainer",
"esri/kernel",
'esri/graphic',
'esri/layers/GraphicsLayer',
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/Color"
], function (
FeatureLayer, Extent, graphicsUtils, Query, QueryTask, Map,
dom, parser, ready, on, ContentPane, BorderContainer, kernel, Graphic, GraphicsLayer, SimpleMarkerSymbol, SimpleLineSymbol, Color
) {
parser.parse();
ready(function(){
var map = new Map("map",{
basemap: "topo",
center:[-71.7018, -33.0228],
zoom:8,
spatialReference: 32719
});
//Load a FeatureTable to the application once map loads
map.on("load", loadData);
var gLayerFind = new GraphicsLayer();
function loadData(){
var l = login(kernel)
.then(resolve=>{
console.log(resolve)
var gLayerMedidor2 = new GraphicsLayer();
var r = Math.floor(Math.random() * 255);
var g = Math.floor(Math.random() * 255);
var b = Math.floor(Math.random() * 255);
var mySymbol = new esri.symbol.SimpleMarkerSymbol(
esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 30,
new esri.symbol.SimpleLineSymbol(
esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new esri.Color([0, 40, 255, 0.9]),
1
),
new esri.Color([255, 51, 255, 0.7])
);
var p = loadPostes(Query,QueryTask, map, resolve[1], ["678742","678743"])
.then(resolve=>{
console.log(resolve,"pipes")
resolve.map(r=>{
gLayerFind.add(new Graphic(resolve[0].geometry,mySymbol));
map.centerAndZoom(resolve[0].geometry,17);
});
map.addLayer(gLayerFind,1);
//
// map.graphics.add(new Graphic(featureSet.features[0].geometry, mySymbol));
}).catch(error=>{
console.log(error, "error postes")
})
}).catch(reject=>{
console.log(reject)
})
}
});
});
</script> And the loadPostes fx is: function loadPostes(Query, QueryTask, map, layers, rotulos){
var entregas = "";
for (let index = 0; index < rotulos.length; index++) {
(index == rotulos.length-1) ? entregas = entregas + `rotulo = '${rotulos[index]}'` : entregas = entregas + `rotulo = '${rotulos[index]}' or `;
}
var promise = new Promise((resolve,reject)=>{
console.log(entregas)
var qTaskInterruptions = new QueryTask(layers.pole_layer);
var qInterruptions = new Query();
qInterruptions.returnGeometry = true;
qInterruptions.outFields=["*"];
qInterruptions.where = entregas;
qInterruptions.outSpatialReference = {wkid:32719};
qTaskInterruptions.execute(qInterruptions, (featureSet)=>{
if(!featureSet.features.length){
reject([]);
}
resolve(featureSet.features)
}, (Errorq)=>{
console.log(Errorq,"Error doing query for rotulos");
reject([]);
});
});
return promise;
} Right now i am having a problem with this If for example i delete this line map.centerAndZoom(resolve[0].geometry,17); and i start the app i am not having errors, but i still dont see the graphics on the map. If i put that line again, i got the error about wkid. What am i doing wrong? Thanks in advice!
... View more
10-16-2019
06:52 AM
|
0
|
2
|
673
|
POST
|
I think that code is ok, right? So Idk what i am doing wrong...
... View more
10-16-2019
05:30 AM
|
0
|
0
|
673
|
POST
|
Here : var p = loadPostes(Query,QueryTask, map, resolve[1], ["678742","678743"]) .then(resolve=>{ console.log(resolve,"pipes") resolve.map(r=>{ console.log(r,"erre") gLayerMedidor2.add(new Graphic(r.geometry,mySymbol)); }); // map.graphics.add(new Graphic(featureSet.features[0].geometry, mySymbol)); map.addLayer(gLayerMedidor2) }).catch(error=>{ console.log(error, "error postes") })
... View more
10-15-2019
01:46 PM
|
0
|
0
|
1221
|
POST
|
OK , I did but i still dont see the graphics on the map
... View more
10-15-2019
01:24 PM
|
0
|
3
|
1216
|
POST
|
My query is the following: var promise = new Promise((resolve,reject)=>{
var qTaskInterruptions = new QueryTask(layers.pole_layer);
var qInterruptions = new Query();
qInterruptions.returnGeometry = true;
qInterruptions.outFields=["*"];
qInterruptions.where = entregas;
qTaskInterruptions.execute(qInterruptions, (featureSet)=>{
if(!featureSet.features.length){
reject([]);
}
resolve(featureSet.features)
}, (Errorq)=>{
console.log(Errorq,"Error doing query for rotulos");
reject([]);
});
});
return promise;
And in the rest service i have the Spatial Reference: 32719 (32719) So...where should i put that in the query?
... View more
10-15-2019
01:14 PM
|
0
|
5
|
1216
|
POST
|
This is my new code <script> require([ "esri/layers/FeatureLayer", "esri/geometry/Extent", "esri/graphicsUtils", "esri/tasks/query", "esri/tasks/QueryTask", "esri/map", "dojo/dom", "dojo/parser", "dojo/ready", "dojo/on", "dijit/layout/ContentPane", "dijit/layout/BorderContainer", "esri/kernel", 'esri/graphic', 'esri/layers/GraphicsLayer', "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/Color" ], function ( FeatureLayer, Extent, graphicsUtils, Query, QueryTask, Map, dom, parser, ready, on, ContentPane, BorderContainer, kernel, Graphic, GraphicsLayer, SimpleMarkerSymbol, SimpleLineSymbol, Color ) { parser.parse(); ready(function(){ var map = new Map("map",{ basemap: "topo", center:[-71.7018, -33.0228], zoom:8 }); //Load a FeatureTable to the application once map loads map.on("load", loadData); function loadData(){ var l = login(kernel) .then(resolve=>{ console.log(resolve) var gLayerMedidor2 = new GraphicsLayer(); var r = Math.floor(Math.random() * 255); var g = Math.floor(Math.random() * 255); var b = Math.floor(Math.random() * 255); var mySymbol = new SimpleMarkerSymbol( SimpleMarkerSymbol.STYLE_CIRCLE, 20, new SimpleLineSymbol( SimpleLineSymbol.STYLE_SOLID, new Color([r, g, b, 0.5]), 10 ), new Color([r, g, b, 0.9])); var p = loadPostes(Query,QueryTask, map, resolve[1], ["678742","678743"]) .then(resolve=>{ console.log(resolve,"pipes") resolve.map(r=>{ gLayerMedidor2.add(new Graphic(r.geometry,mySymbol)); }); // map.graphics.add(new Graphic(featureSet.features[0].geometry, mySymbol)); map.addLayer(gLayerMedidor2) }).catch(error=>{ console.log(error, "error postes") }) }).catch(reject=>{ console.log(reject) }) } }); }); </script>
... View more
10-15-2019
11:51 AM
|
0
|
10
|
1216
|
POST
|
Hello everyone, I am wondering why this code is not showing any graphic in a map. I have the following: <script>
require([
"esri/layers/FeatureLayer",
"esri/geometry/Extent",
"esri/graphicsUtils",
"esri/tasks/query",
"esri/tasks/QueryTask",
"esri/map",
"dojo/dom",
"dojo/parser",
"dojo/ready",
"dojo/on",
"dijit/layout/ContentPane",
"dijit/layout/BorderContainer",
"esri/kernel",
'esri/graphic',
'esri/layers/GraphicsLayer',
"esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol",
"esri/Color"
], function (
FeatureLayer, Extent, graphicsUtils, Query, QueryTask, Map,
dom, parser, ready, on, ContentPane, BorderContainer, kernel, Graphic, GraphicsLayer, SimpleMarkerSymbol, Color, SimpleLineSymbol
) {
parser.parse();
ready(function(){
var map = new Map("map",{
basemap: "topo",
center:[-71.7018, -33.0228],
zoom:8
});
//Load a FeatureTable to the application once map loads
map.on("load", loadData);
function loadData(){
var l = login(kernel)
.then(resolve=>{
console.log(resolve)
var gLayerMedidor2 = new GraphicsLayer();
var r = Math.floor(Math.random() * 255);
var g = Math.floor(Math.random() * 255);
var b = Math.floor(Math.random() * 255);
var mySymbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
20, new SimpleLineSymbol(
SimpleLineSymbol.STYLE_SOLID,
new Color([r, g, b, 0.5]),
10
),
new Color([r, g, b, 0.9]));
var p = loadPostes(Query,QueryTask, map, resolve[1], ["678742","678743"])
.then(resolve=>{
console.log(resolve,"pipes")
gLayerMedidor2.add(new Graphic(resolve[0].geometry,mySymbol));
console.log(resolve[0].geometry)
// map.graphics.add(new Graphic(featureSet.features[0].geometry, mySymbol));
map.addLayer(gLayerMedidor2)
}).catch(error=>{
console.log(error, "error postes")
})
}).catch(reject=>{
console.log(reject)
})
}
});
});
</script> Also in the loadPostes i have a promise that works like: function loadPostes(Query, QueryTask, map, layers, rotulos){
var entregas = "";
for (let index = 0; index < rotulos.length; index++) {
(index == rotulos.length-1) ? entregas = entregas + `rotulo = '${rotulos[index]}'` : entregas = entregas + `rotulo = '${rotulos[index]}' or `;
}
var promise = new Promise((resolve,reject)=>{
var qTaskInterruptions = new QueryTask(layers.pole_layer);
var qInterruptions = new Query();
qInterruptions.returnGeometry = true;
qInterruptions.outFields=["*"];
qInterruptions.where = entregas;
qTaskInterruptions.execute(qInterruptions, (featureSet)=>{
if(!featureSet.features.length){
reject([]);
}
resolve(featureSet.features)
}, (Errorq)=>{
console.log(Errorq,"Error doing query for rotulos");
reject([]);
});
});
return promise;
} The promise is actualyl working fine cuz i have the result in console but it just not adding the graphics into the map to see them. What am i doing wrong? Thanks in advice!
... View more
10-15-2019
11:35 AM
|
0
|
13
|
1987
|
POST
|
Hello, I want to ask what permissions should i have to make this works. I am having the following issue. I already have the permissions on group in arcgis manager, but i am still having the same error. What am i doing wrong? Thanks in advice! Arcgis 10.6
... View more
09-30-2019
08:38 AM
|
0
|
3
|
447
|
Title | Kudos | Posted |
---|---|---|
1 | 06-21-2017 02:09 PM | |
1 | 10-09-2018 07:10 AM | |
1 | 03-23-2016 10:53 AM | |
1 | 04-10-2015 07:52 AM | |
1 | 07-24-2017 01:55 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|