|
POST
|
Thanks, it help me a lot, i will continue developing
... View more
03-05-2015
12:44 PM
|
0
|
0
|
1754
|
|
POST
|
As always, thanks for ur help Robert, now i can understand that js is a very sensitive language to learn!. I have another question related with Dynamic Layers. Is there a way to get the data in a popupwindow from a dynamic layer to be shown? I have a service that the only way to be shown propertly is adding a Dynamic Layer, but the thing i want to do is, when the user clic one feature, it displays a popup with the info about that feature that he was clicking. I can do it through a feature service easily, but when i try to put the dynamic layer and the feature layers using the "map.addLayers(dynamicLayer,featureLayer1,featureLayer2,...etc)" i cannot see the information about. (Seems like it is overwritten for the dynamic layer as a image). The code is the same that i showed in the beginning, but i want to add a Dynamic Layer + FeatureLayers. Like: var map;
var identityManagerOK ="NO";
//Establece todo lo requerido para funcionar. "LIBRERIAS"
require([
"dojo/_base/array",
"dojo/parser",
"esri/config",
"esri/dijit/editing/Editor",
"esri/dijit/editing/TemplatePicker",
"esri/layers/FeatureLayer",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/ImageParameters",
"esri/map",
"esri/IdentityManager",
"dijit/layout/ContentPane",
"dijit/layout/BorderContainer",
"dojo/domReady!"],
function (arrayUtils, parser, esriConfig, Editor, TemplatePicker, FeatureLayer, ArcGISDynamicMapServiceLayer, ImageParameters, Map, IdentityManager){
parser.parse();
esriConfig.defaults.io.proxyUrl = "/proxy/";
//GENERA UN MAPA BASE
map = new Map("map", {
basemap: "topo",
center: [-71.0659,-32.9252], // longitude, latitude
zoom: 8
});
//add editor when secureLayer is added.
map.on("layers-add-result", initEditing);
//add the feature layer - secure service - token is required
var secureLayer = new FeatureLayer("",
{ mode: FeatureLayer.MODE_ONDEMAND,outFields: ["nombre"] });
var imageParameters = new ImageParameters();
imageParameters.format = "jpeg"; //set the image type to PNG24, note default is PNG8.
//My dynamicLayer map server
var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("", {
"opacity" : 0.5,
"imageParameters" : imageParameters
});
dynamicMapServiceLayer.setVisibleLayers([1,2,5]);
//Add layers to the map
map.addLayers([dynamicMapServiceLayer,secureLayer]);
//Genera el infowindow para mostrar datos
map.infoWindow.resize(200, 200);
function initEditing(event){
// alert("entre");
var results = event.layers;
var featureLayerInfos = arrayUtils.map(results, function (result){
return {
"featureLayer": result.layer
};
});
var layers = arrayUtils.map(results, function (result){
return result.layer;
});
var templatePicker = new TemplatePicker({
featureLayers: layers,
rows: 'auto',
columns: 2
}, "templatePickerDiv");
templatePicker.startup();
//setup the editor widget
var settings = {
map: map,
templatePicker: templatePicker,
layerInfos: featureLayerInfos
};
var params = {
settings: settings
};
var editorWidget = new Editor(params);
map.enableSnapping();
editorWidget.startup();
//VARIABLE PARA SABER SI EL LOGIN CORRESPONDE O NO
identityManagerOK="YES";
//alert(identityManagerOK);
}
identityManagerOK="NO";
// alert(identityManagerOK);
});
... View more
03-05-2015
09:49 AM
|
0
|
2
|
1754
|
|
POST
|
Hello, im new programming in javascript (i used to developed flex applications) and im migrating a app that i made in flex to js. Im having the following issue that will sound very simple: 1.- How can i add a dynamic layer to the map? 2.- is it possible throught the dynamic layer get some info or i need to do it with the feature layers? I have this code but idk why it doesnt work. I read already the API and try the examples but still doesnt work. Im new using require so im trying to learn how it works but this time it just load my featurelayer, not the dynamic one. I hope u can help me guys Thanks so much! IdentityManager.js var map;
var identityManagerOK ="NO";
//Establece todo lo requerido para funcionar. "LIBRERIAS"
require([
"dojo/_base/array",
"dojo/parser",
"esri/config",
"esri/dijit/editing/Editor",
"esri/dijit/editing/TemplatePicker",
"esri/layers/FeatureLayer",
"esri/layers/ArcGISDynamicMapServiceLayer",
"esri/layers/ImageParameters",
"esri/map",
"esri/IdentityManager",
"dojo/domReady!",
"dijit/layout/ContentPane",
"dijit/layout/BorderContainer"],
function (arrayUtils, parser, esriConfig, Editor, TemplatePicker, ArcGISDynamicMapServiceLayer, ImageParameters,FeatureLayer, Map){
parser.parse();
esriConfig.defaults.io.proxyUrl = "/proxy/";
//GENERA UN MAPA BASE
map = new Map("map", {
basemap: "topo",
center: [-71.0659,-32.9252], // longitude, latitude
zoom: 8
});
//add editor when secureLayer is added.
map.on("layers-add-result", initEditing);
//add the secure service - token is required
var secureLayer = new FeatureLayer("",
{ mode: FeatureLayer.MODE_ONDEMAND,outFields: ["nombre"] });
var imageParameters = new ImageParameters();
imageParameters.format = "jpeg"; //set the image type to PNG24, note default is PNG8.
//Takes a URL to a non cached map service.
var dynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer("http://maps.decaturil.gov/arcgis/rest/services/Public/InternetVector/MapServer", {
"opacity" : 0.5,
"imageParameters" : imageParameters});
//Agrega los layers al mapa
map.addLayers([secureLayer,dynamicMapServiceLayer]);
//Genera el infowindow para mostrar datos
map.infoWindow.resize(200, 200);
function initEditing(event){
alert("entre");
var results = event.layers;
var featureLayerInfos = arrayUtils.map(results, function (result){
return {
"featureLayer": result.layer
};
});
var layers = arrayUtils.map(results, function (result){
return result.layer;
});
var templatePicker = new TemplatePicker({
featureLayers: layers,
rows: 'auto',
columns: 2
}, "templatePickerDiv");
templatePicker.startup();
//setup the editor widget
var settings = {
map: map,
templatePicker: templatePicker,
layerInfos: featureLayerInfos
};
var params = {
settings: settings
};
var editorWidget = new Editor(params);
map.enableSnapping();
editorWidget.startup();
//VARIABLE PARA SABER SI EL LOGIN CORRESPONDE O NO
identityManagerOK="YES";
//alert(identityManagerOK);
}
identityManagerOK="NO";
// alert(identityManagerOK);
});
... View more
03-05-2015
05:39 AM
|
0
|
4
|
4427
|
|
POST
|
Hi guys, i hope u can help me. Im trying to get the code in flex for deleting a row in s grid that i have using the applyedits but i cannot. How can i do that? Thx 🙂
... View more
02-27-2015
06:14 AM
|
0
|
3
|
3976
|
|
POST
|
Hello, Im wondering if theres a way to know what users or what thing is triggering a problem with the number of instances. My arcgis srv shows that i have all of my instances (3) busy and the rest service takes too long to dispose all the queries done. Idk what thing is making the issue, cuz its first time that i see this problem. With the other layers i dont have that prob, just with one. Thanks for all ur help
... View more
12-16-2014
07:15 AM
|
0
|
0
|
2562
|
|
POST
|
Hello, Just now i had an old version of flex viewer and i tried to load in on my browser but i have the following errors: Config manager: Fault code: InvokeFailed Fault info: Error #2148 Fault details: null Viewer Container: Some error occurred. ExternalInterface doesn't work in Standalone player I downloaded the 3.7 version and i still have the same issue, so how can i fix it? Thanks!
... View more
12-12-2014
07:01 AM
|
0
|
1
|
2124
|
|
POST
|
Well, i did what u said, but im still having an issue with the eGridColumn. And i cannot see that is the problem. am I doing something wrong on the widget? The agregarItems() function get the result for the view (4 fields) (coleccion = new ArrayCollection(featureSet.attributes); and (datos.dataProvider = coleccion;). I need to convert the fc_evento field to a datetime, cuz it is milliseconds. Grid: <s:DataGrid id="datos" dataProvider="{coleccion}" resizableColumns="true" sortableColumns="true" contentBackgroundAlpha="1" width="100%" height="90%" visible="true" editable="false" bottom="1"> <s:columns> <s:ArrayList> <s:GridColumn id="fc_evento" dataField="fc_evento" headerText="fc_evento"></s:GridColumn> <s:GridColumn id="gl_ip" dataField="gl_ip" headerText="gl_ip" ></s:GridColumn> <s:GridColumn id="gl_param_ejec" dataField="gl_param_ejec" headerText="gl_param_ejec" ></s:GridColumn> <s:GridColumn id="gl_mensaje" dataField="gl_mensaje" headerText="gl_mensaje" ></s:GridColumn> </s:ArrayList> </s:columns> </s:DataGrid> <s:Button id="BuscarCapex" label="Buscar" click="BuscarCapex_clickHandler(event)"></s:Button> //Functions protected function BuscarCapex_clickHandler(event:MouseEvent):void { // TODO Auto-generated method stub //IdentityManager.instance.enabled = true; agregarItems(); fc_evento.labelFunction = getDateLbl; } private function getDateLbl(item:Object,column:GridColumn):String { var dateMS:Number = Number(item[column.dataField]); var retVal:String = ""; var rVal:String = item[column.dataField]; var dateFormatStr:String; var cuseUTC:Boolean; if(rVal == null){ //do nothing }else{ if (!isNaN(dateMS)){ //Fix the date format to use the Spark format if(column is eGridColumn){ dateFormatStr = (column as eGridColumn).DateFormat; cuseUTC = (column as eGridColumn).useUTC; } dateFormatStr = dateFormatStr.replace(/D/g, "d").replace(/Y/g, "y"); retVal = msToDate(dateMS, dateFormatStr, cuseUTC); } } return retVal; } private function msToDate(ms:Number, dateFormat:String, useUTC:Boolean):String { var date:Date = new Date(ms); if (date.milliseconds == 999){ // workaround for REST bug date.milliseconds++; } if (useUTC){ date.minutes += date.timezoneOffset; } if (dateFormat){ dateFormatter.dateTimePattern = dateFormat; var result:String = dateFormatter.format(date); if (result){ return result; }else{ return dateFormatter.errorText; } }else{ return date.toLocaleString(); } } Idk what im doing wrong... Thanks for ur patience
... View more
12-02-2014
07:56 AM
|
0
|
2
|
1933
|
|
POST
|
the import for dateFormatter and dateFormatter.dateTimePattern i cannot find them. I have tried import mx.formatters.DateFormatter; Another question, i was doing a itemrenderer based on the gridcolumn but i cannot use the function to convert the value. BTW, im making this for a widget. Thanks
... View more
12-02-2014
07:09 AM
|
0
|
4
|
1933
|
|
POST
|
Hello everybody, I have a view that contains a date field and when i use the service to show the data, the service automatically return the date in miliseconds. Is there a way to change that? Cuz the view has the field correctly and i dont know why the service changes the value. Example: fc_evento: 1417427606000 (in arcgis srv) It has to show 1/12/14 4:53 (in view) Thanks
... View more
12-02-2014
04:27 AM
|
0
|
6
|
5396
|
|
POST
|
I understood. Well actually the thing i wanted to do is, throught the user id from the identity manager, restrict some combobox or objects that i dont want to show on a widget. The thing i did was create another table using the userid and another field called permission and put the objects that i want to show for that user in the widget. Then i could solve my problem with 2 queries app. The other issue that i was thinking if , actually i manage one database in arcgisserver with their layers, but i noticed that if i go to the API u can create more arcgis databases, so if i create another the original one doesnt change the structure?. Well, anyways thanks for ur help as always i will keep developing things on flex until the end XD
... View more
11-18-2014
09:17 AM
|
0
|
1
|
825
|
|
POST
|
Hello, I want to ask. Is there a way to restrict the mount of widget that i can see in the flex viewert with some user permission? Cuz i need to make a widget that just few people have to had access and do some query from another database (SQL). How can i do that? is there any example? And another question is, what is the risk of having multiple database in arcgisserver? how can u create another one? Thanks for ur answers
... View more
11-13-2014
05:51 AM
|
0
|
3
|
2349
|
|
POST
|
Thank you for ur answer, that was correct. But my question is : why before the definition expression let me do that and it showed the correct result and now i have to change it? is it for any update? Thanks again
... View more
10-27-2014
11:09 AM
|
0
|
1
|
1154
|
|
POST
|
<esri:FeatureLayer id="edicionLuminaria" url="http://gisred.chilquinta.cl:5555/arcgis/rest/services/AP_Municipal/AP_MUNICIPAL/FeatureServer/0" outFields="*" visible="true" definitionExpression="WHERE Comuna='LA CRUZ'"/>
... View more
10-27-2014
06:55 AM
|
0
|
3
|
1154
|
|
POST
|
Hello everybody. Some months ago i developed a arcgis for flex app that shows features from a city , defining what city i want to show features with definition expression = "where city='alabama' " (for ex) Some days ago, i cannot see any feature and i was trying to resolve the prob by myself, and i realized that if i put off the definition expression parameter where i define the map layers , the features are shown but not doing the filter that i want. Is there any problem with the definition expression parameter? or is another thing that is making a prob? Beforehand , thanks for ur answer.
... View more
10-27-2014
06:34 AM
|
0
|
5
|
4609
|
| 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
|