|
POST
|
04-17-2017
01:02 PM
|
0
|
1
|
868
|
|
POST
|
Nice!, i was wondering if that was added in the 3.20 version but no. FeatureLayer | API Reference | ArcGIS API for JavaScript 3.20
... View more
04-06-2017
01:31 PM
|
0
|
2
|
4692
|
|
POST
|
Yea, i did it in that way, I also did the example with a feature layer but it renders slower than dynamic. Thanks for ur help
... View more
03-07-2017
06:20 AM
|
0
|
0
|
909
|
|
POST
|
So i still dont understand the meaning of enabling or disabling the mobile access
... View more
03-07-2017
05:50 AM
|
0
|
1
|
1479
|
|
POST
|
Hello there, Im wondering if theres a way to handle a popup on a dynamic service when the users put their mouse on a feature (on mouse over event). I know its possible to do it with featurelayers, but since im working with dynamic service i dont know if this is possible. I looked into the api for dynamic layers and there is not a event for on mouse over. I share what i have on my code: var mapp = mymap.createMap("map","topo",this.state.country[0].extent[0], this.state.country[0].extent[1],12);
var layerDefinitions = [];
layerDefinitions[0] = "COUNTRY= '"+ this.state.COUNTRY[0].queryName+"'";
layerDefinitions[1] = "COUNTRY= '"+ this.state.COUNTRY[0].queryName+"'";
layerDefinitions[2] = "COUNTRY= '"+ this.state.COUNTRY[0].queryName+"'";
layerDefinitions[4] = "COUNTRY= '"+ this.state.COUNTRY[0].queryName+"'";
var carsLayer = new ArcGISDynamicMapServiceLayer(layers.read_dynamic_ap(),{});
carsLayer .setImageFormat("png32");
carsLayer .setVisibleLayers([0]);
carsLayer .setLayerDefinitions(layerDefinitions);
var streetsLayer = new ArcGISDynamicMapServiceLayer(layers.read_dynamic_ap(),{ minScale: 6000});
streetsLayer .setImageFormat("png32");
streetsLayer .setVisibleLayers([1]);
streetsLayer .setLayerDefinitions(layerDefinitions);
var peopleLayer = new ArcGISDynamicMapServiceLayer(layers.read_dynamic_ap(),{minScale: 6000});
peopleLayer .setImageFormat("png32");
peopleLayer .setVisibleLayers([2]);
peopleLayer .setLayerDefinitions(layerDefinitions);
var countryLayer = new ArcGISDynamicMapServiceLayer(layers.read_dynamic_ap(),{});
countryLayer .setImageFormat("png32");
countryLayer .setVisibleLayers([4]);
countryLayer .setLayerDefinitions(layerDefinitions);
mapp.addLayers([countryLayer , peopleLayer ,streetsLayer , carsLayer]);
this.setState({dynamicService: [countryLayer , peopleLayer , streetsLayer , carsLayer]});
mapp.on('click', (event)=>{
$('.drawer_progressBar2').css('visibility',"visible");
var identifyTask, identifyParams;
identifyTask = new IdentifyTask(layers.read_dynamic_ap());
identifyParams = new IdentifyParameters();
identifyParams.tolerance = 10;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [0, 1];
identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
identifyParams.width = mapp.width;
identifyParams.height = mapp.height;
identifyParams.geometry = event.mapPoint;
identifyParams.mapExtent = mapp.extent;
var onlyLum = [];
//Use promisses to get results from identityTask in layers 0 and 1
var deferred = identifyTask.execute(identifyParams, (callback)=>{
if(!callback.length){
console.log("no length", callback);
}else{
let arrResults = callback.map(result => {
let r = {
features: result.feature,
layerName: result.layerName
}
return r;
});
this.setState({allElements: arrResults});
// Show edition window for each street selected.
this.onShowCurrent(arrResults,0);
onlyStreet = arrResults.filter(element =>{ return element.layerName=='Streets' });
//get the first element .
this.setState({counterTotal: onlyLum.length, counter: 1, allElements: onlyLum, currentIndex: 0});
$('.drawer_progressBar2').css('visibility',"hidden");
$('.wrapperTop_midTitle h6').addClass('wrapperTop_midTitle-h6');
$('.muniTitulo').addClass('muniTitulo-40percent');
}
},(errback)=>{
console.log("ee",errback);
});
//add infowindow ----------------------------------------------------
deferred.addCallback(function (response){
//get only the info from streets to generate infowindow .
let res = response.filter((r)=>{return r.layerName=="Streets"});
return arrayUtils.map(res, function (result) {
var feature = result.feature;
var layerName = result.layerName;
var onlyStreets = [];
feature.attributes.layerName = layerName;
if(layerName === 'Streets'){
var streetsTemplate = new InfoTemplate("ID Luminaria: ${ID_STREET}",
"NAME: ${NAME} <br />" +
"CONCURRENT: ${CONCURRENT}<br /> " +
"DANGER: ${DANGER} <br/> ");
feature.setInfoTemplate(streetsTemplate);
onlyStreets .push(feature);
}
return feature;
});
});
mapp.infoWindow.setFeatures([deferred]);
mapp.infoWindow.show(event.mapPoint);
});
... View more
03-07-2017
05:13 AM
|
0
|
2
|
1646
|
|
POST
|
Hello there, Im having a question, following this help : Servicios de datos móviles—Documentación (10.3 y 10.3.1) | ArcGIS Enterprise I am looking for any example on how to add a mobileServer layer programmaticaly in android and how it works on getting the info. I dont think i need to simple use ArcGISDynamicMapServiceLayer cuz i know only accept layer ending with MapServer. Thanks for all ur help as always!
... View more
03-06-2017
10:16 AM
|
0
|
3
|
2122
|
|
POST
|
Hello, I have an app where i need to save the results on a custom array. They come from the deferred identify task when an user clicks on the map. I have the following: mapp.on('click', (event)=>{
var identifyTask, identifyParams;
identifyTask = new IdentifyTask(layers.read_dynamic_ap());
identifyParams = new IdentifyParameters();
identifyParams.tolerance = 10;
identifyParams.returnGeometry = true;
identifyParams.layerIds = [0, 1];
identifyParams.layerOption = IdentifyParameters.LAYER_OPTION_ALL;
identifyParams.width = mapp.width;
identifyParams.height = mapp.height;
identifyParams.geometry = event.mapPoint;
identifyParams.mapExtent = mapp.extent;
var deferred = identifyTask
.execute(identifyParams)
.addCallback(function (response){
return arrayUtils.map(response, function (result) {
var feature = result.feature;
var layerName = result.layerName;
feature.attributes.layerName = layerName;
if(layerName === 'Cars'){
var carsTemplate= new InfoTemplate("ID: ${id}",
"Car: ${car} <br />" +
"Type: ${type}<br /> ");
feature.setInfoTemplate(carsTemplate);
}
return feature;
});
});
mapp.infoWindow.setFeatures([deferred]);
mapp.infoWindow.show(event.mapPoint);
//see content :
console.log("hello def", deferred.results);
}); In the same point could be more than 1 result, so i want to save them all in a custom array made for me for special purposes. When i see the content coming for that deferred var i have this: console.log("hello def", deferred); Where i can see there is a property called results (its an array). I tried to put in console.log(deferred.results) but i get undefined. There is a way how to save those results? What im doing wrong? Thanks in advice.
... View more
03-03-2017
08:15 AM
|
0
|
1
|
1001
|
|
POST
|
Well its something i was thinking yesterday. I solved the problem already. Here its what i did (could be useful for someone) (im using es6 and react): 1.- I set layer definitions for each sublayer on the Dynamic Service. ( var layerDefinitions = [];
layerDefinitions[0] = "COUNTRY = '"+ this.state.COUNTRY [0].queryName+"'";
layerDefinitions[1] = "COUNTRY = '"+ this.state.COUNTRY [0].queryName+"'";
2.- I set a variable per many sublayer i wanted to add to the map. In this case im going to show just 2, one with scale and one with the default scale (for seeing for afar). Also i set the layer defs for each one. var carsLayer = new ArcGISDynamicMapServiceLayer(layers.read_dynamic_ap(),{ minScale: 6000});
carsLayer .setImageFormat("png32");
carsLayer .setVisibleLayers([0]);
carsLayer .setLayerDefinitions(layerDefinitions);
var streetsLayer = new ArcGISDynamicMapServiceLayer(layers.read_dynamic_ap(),{});
streetsLayer .setImageFormat("png32");
streetsLayer .setVisibleLayers([1]);
streetsLayer .setLayerDefinitions(layerDefinitions); 3.- I added them to the map in the secuence i want to show them (for example i want the streets goes first, so i put it at last) mapp.addLayers([carsLayer , streetsLayer ]);
4.- Then how i wanna save the layers in some variable to use the show() and hide() method for the layerlist i made, i just keep them in dynamicService. this.setState({dynamicService: [carsLayer, streetsLayer]}) Then , for my custom layerList i made, i just change the visibility doing : this.state.dynamicService[0].show(); //the number is the position of the layer i saved and im going to use, this case is cars. Thanks for all the help! I figure out how to solve my issue
... View more
03-03-2017
06:05 AM
|
1
|
0
|
1800
|
|
POST
|
Hello there, Im trying to see how can i set the layer scale in a ArcGISDynamicMapServiceLayer. I have a service with this kind of url services/mycitycity/MapServer which contains 3 sublayers: cars, streets, people. So i did this code for adding the layer to a map (im using es6) var myLayer = new ArcGISDynamicMapServiceLayer(layers.read_dynamic_ap(),{});
myLayer .setImageFormat("png32");
var layerDefinitions = [];
layerDefinitions[0] = "country= '"+ this.state.country[0].queryName+"'";
layerDefinitions[1] = "country= '"+ this.state.country[0].queryName+"'";
layerDefinitions[2] = "country= '"+ this.state.country[0].queryName+"'";
layerDefinitions[4] = "country = '"+ this.state.country[0].queryName+"'";
myLayer .setLayerDefinitions(layerDefinitions);
mapp.addLayer(myLayer ); So when i see the layers on the map, its ok, but i want to show them in a different scale every one due to one of them contains too much data, and when u see it from afar, i get this: I dont know if i should separate each dynamic layer and add them using mapp.addLayers(dynLayer1,dynLayer2,dynLayer3) or how to set the scale separately. Also i want to know how can i put the visibility on and off for each one in case i need to separate them. Any example code should be great. I have been looking this websites: ArcGIS API for JavaScript Sandbox : cuz the main reason im changing the layers to dynamic (i use featured) its about the identify element over there. ArcGISDynamicMapServiceLayer | API Reference | ArcGIS API for JavaScript 3.19 Thanks in advice!
... View more
03-02-2017
12:54 PM
|
0
|
2
|
2667
|
|
POST
|
Maybe if u provide a clear example of the code u have we can see whats wrong with it.
... View more
02-06-2017
01:34 PM
|
0
|
0
|
2194
|
|
POST
|
Hello there, here comes an example : var myTitle = "Hello";
var sum1 ="there";
var point = feature.attributes.geometry;
var content = `<div style=padding-top: 10px;>Title: ${myTitle}<br /></div>
<div style=padding-top: 10px;>Sum1: ${sum1}<br /></div>`;
map.infoWindow.resize(450, 250);
map.infoWindow.setContent(esri.substitute(esri.geometry.webMercatorToGeographic(point), content));
... View more
02-03-2017
08:49 AM
|
0
|
0
|
3107
|
|
POST
|
I think i remember to solve this problem using a indicator on what position i want to add the graphic layer or layer to the map, like: map.addLayer(mygraphiclayer,2) map.addLayer(layer,1)
... View more
02-03-2017
08:20 AM
|
0
|
2
|
2194
|
|
POST
|
Hello, i have this alternative for u, i hope this helps u. var userData = 1; //this contain the objectid number. And if its more than one, needs to be an array of objectids {[1,2,3]}
import _ from 'lodash';
function delSomething(userData,callback){
const data = {
f: 'json',
deletes: userData,
token: token.read()
};
jQuery.ajax({
method: 'POST',
url: myurltoservice + "/applyedits",
dataType:'html',
data: data
})
.done(d =>{
console.log(d);
let json = JSON.parse(d);
if( (_.has(json,'error')) ){
return callback(false);
}else{
let arrObject = [];
if(json["deleteResults"][0].objectId>0){
return callback(true);
}else{
return callback(false);
}
}
})
.fail(f=>{
console.log(f,"no pase")
callback(false)
});
}
... View more
01-31-2017
01:38 PM
|
0
|
0
|
810
|
|
POST
|
Actually if u are passing the token for every layer u added it doesnt have to ask u for password for each action u do on the map. Make sure u are doing it well and the token works for every service u have.
... View more
12-13-2016
04:38 AM
|
0
|
1
|
1308
|
|
POST
|
The token allows u to bypass the IdentityManager in some way (by ajax u can do it but u need to provide the user and pass for getting the token). If u use arcgis online to visualize the layers it will ask u for the user and pass cuz they are secured services. Every secured service u need to log in with ur credentials. Or using the bypass that i told u (but it will work in apps that u want to develop).
... View more
12-12-2016
01:42 PM
|
0
|
3
|
1308
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-21-2017 02:09 PM | |
| 1 | 04-10-2015 07:52 AM | |
| 1 | 03-23-2016 02:08 PM | |
| 1 | 02-22-2016 05:01 AM | |
| 1 | 10-09-2018 07:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
05-01-2024
03:05 AM
|