|
POST
|
Nigel, I did and i have another kind of error, TypeError: Error #1009: Cannot access a property or method of a null object reference. The widget that im doing has to get some information and the attachment related to that info. Im using this layer: Layer: ARCGIS.DBO.MANTENIMIENTO_CONTROL_PODAS (ID: 4) Example: Here i have 2 attachments: Attachment Infos (Feature ID: 2807) And i need to see on a form the preview image saved in the service (with other info that i already have done through code). After that, the user can modify or eliminate the info related (could be just the info, just the attachment or both). So, for that now i need to see how to get the attachments ID for modifying or deleting the images, but how u told me before i cannot modify through code (just service allows it) my option is deleting the attachment and create them again (for modifying). Now with the code it is atleast passing the onResult function, but now how i get the url images and the attachment IDs related, it isnt just a pic, can be max 2). My code is getting like this: public function loadingPictures():void{
var arrayInfos:ArrayCollection = new ArrayCollection;
//buscarOBJIDActividad(numAct:int, numSoli:int)
var objActividad:int= DataActividades.selectedItem['OBJECTID'];
myActividadLayer.queryAttachmentInfos(objActividad,new AsyncResponder(onResult,onFault));
function onResult(event:Object, token:Object=null):void{
var arry:Array = event.attachmentInfos;
var attachmentInfo:AttachmentInfo= arry[0];
var imageUrlAntes:String = String(attachmentInfo.url);
var attachmentInfo2:AttachmentInfo= arry[1];
var imageUrlDespues:String = attachmentInfo2.url;
var imageAntes : Image = new Image();
imageAntes.source = imageUrlAntes;
imageAntes.scaleContent = true;
imageAntes.maintainAspectRatio =false;
imageAntes.percentWidth = 150;
imageAntes.percentHeight = 150;
pbMODAntes1.addChild(imageAntes);
var imageDespues : Image = new Image();
imageDespues.source = imageUrlDespues;
imageDespues.scaleContent = true;
imageDespues.maintainAspectRatio =false;
imageDespues.percentWidth = 150;
imageDespues.percentHeight = 150;
pbMODDespues1.addChild(imageDespues);
}
function onFault(event:Object,token:Object=null):void{
Alert.show("It is not doing anythingAnd i ");
}
} Thanks for all ur help as always
... View more
05-25-2015
07:56 AM
|
0
|
9
|
1778
|
|
POST
|
Yes i ckecked it already with the docs, but now idk what i can do , idk if i can parse the event ..
... View more
05-25-2015
06:45 AM
|
0
|
11
|
1778
|
|
POST
|
Well im having a issue with the event:AttachmentEvent. the debugger says TypeError: Error #1034: Type Coercion failed: cannot convert []@128463f9 to com.esri.ags.events.AttachmentEvent. My code is: public function buscarCargarFotografias():void{
var arrayInfos:ArrayCollection = new ArrayCollection;
//buscarOBJIDActividad(numAct:int, numSoli:int)
var objActividad:int= DataActividades.selectedItem['OBJECTID'];
myActividadLayer.queryAttachmentInfos(objActividad,new AsyncResponder(onResult,onFault));
function onResult(event:AttachmentEvent, token:Object=null):void{
var arry:Array = event.attachmentInfos;
var attachmentInfo:AttachmentInfo= arry[0];
var imageUrlAntes:String = String(attachmentInfo.url);
var attachmentInfo2:AttachmentInfo= arry[1];
var imageUrlDespues:String = attachmentInfo2.url;
var imageAntes : Image = new Image();
imageAntes.source = imageUrlAntes;
imageAntes.scaleContent = true;
imageAntes.maintainAspectRatio =false;
imageAntes.percentWidth = 150;
imageAntes.percentHeight = 150;
pbMODAntes1.addChild(imageAntes);
var imageDespues : Image = new Image();
imageDespues.source = imageUrlDespues;
imageDespues.scaleContent = true;
imageDespues.maintainAspectRatio =false;
imageDespues.percentWidth = 150;
imageDespues.percentHeight = 150;
pbMODDespues1.addChild(imageDespues);
}
... View more
05-25-2015
05:47 AM
|
0
|
13
|
1778
|
|
POST
|
Nigel, im trying now to get the SRC and convert it to a bytearray to make a preview imag. Using the queryAttachmentInfos to get them. I dont understand how to use it well. Later i will have to delete it a image too , so.. is there any example how to use both? Thank you. public function searchAndLoadPics():void{
//my object id for getting the attachment
var objActividad:int= DataActividades.selectedItem['OBJECTID'];
myActividadLayer.queryAttachmentInfos(objActividad, responder:IResponder = null):AsyncToken;
// load the pics on the canvas
var imageAntes : Image = new Image();
imageAntes.source = myByteArrayBefore;
imageAntes.scaleContent = true;
imageAntes.maintainAspectRatio =false;
imageAntes.percentWidth = 150;
imageAntes.percentHeight = 150;
pbMODAntes1.addChild(imageAntes);
var imageDespues : Image = new Image();
//image.
imageDespues.source = myByteArrayAfter;
imageDespues.scaleContent = true;
imageDespues.maintainAspectRatio =false;
imageDespues.percentWidth = 150;
imageDespues.percentHeight = 150;
pbMODDespues1.addChild(imageDespues);
}
... View more
05-20-2015
11:25 AM
|
0
|
15
|
1778
|
|
POST
|
i found my problem. I was using another layer and it doesnt have the "zoom" field Thanks robert
... View more
05-18-2015
06:35 AM
|
0
|
0
|
1081
|
|
POST
|
I receive a NaN value. I know that i have some null values , but "PLACILLA" has a zoom value. I dont know why i cannot get it.
... View more
05-18-2015
06:13 AM
|
0
|
1
|
1081
|
|
POST
|
Hello, I have this code and idk why i cannot get the "zoom" value for the query. function onResult(featureSet:FeatureSet, token:Object = null):void
{
try{
var mapPoint:MapPoint = featureSet.features[0].geometry as MapPoint;
var convert:ConvertCoords = new ConvertCoords;
convert.ToGeographic(mapPoint.x,mapPoint.y);
lat = convert.Y_lat;
long =convert.X_lon;
map.zoomTo(featureSet.features[0].geometry);
//Alert.show("punto: " + mapPoint.x.toString() + " " +mapPoint.y.toString()+ " "+ "lat: " + convert.Y_lat.toString()+ " "+convert.X_lon.toString() );
map.level = 16;
zoom = featureSet.features[0].attributes["zoom"];
Alert.show(zoom.toString());
}catch(err:Error){
Alert.show("no");
}
}
function onFault(info:Object, token:Object = null):void
{
Alert.show("not found");
} Mensaje editado por: Evelyn Hernandez
... View more
05-15-2015
11:09 AM
|
0
|
5
|
4567
|
|
POST
|
Hello, im trying to customize the default infowindow (see attch) to put a new button to open a webpage when i click a determined feature (just the triangle in the pic, cuz there are 5 different features). The thing is i dont know where i can add it or how. If anyone can help me on this will be useful. Thanks
... View more
05-14-2015
08:46 AM
|
0
|
4
|
7705
|
|
POST
|
Yes , but theres a way to not put the require statement in the HTML and put it in another file? or has to be there with the link to the api on <script> statement?. Thats my question. Thanks for ur help!
... View more
05-13-2015
10:40 AM
|
0
|
3
|
6494
|
|
POST
|
Well im actually trying to learn a way to modularize my next project using the Arcgis API for JS and also trying to learn in the process. I just found requireJS to do it, but idk if its the best. The thing that i want to do is put for example this code: require(["esri/map", "dojo/domReady!"], function(Map) { var map = new Map("map", { center: [-118, 34.5], zoom: 8, basemap: "topo" }); }); in a specified js file , not in the main HTML directly. Cuz i have been seen in the sample codes that the api is loaded in the beggining and then put the require in the same html.
... View more
05-13-2015
10:05 AM
|
0
|
5
|
6494
|
|
POST
|
Hello, Idk if im in the correct forum asking this , but idk where can i ask for people that it is just starting to change to js language. I am following a basic requireJS tutorial that i found in this link and following the steps im trying to put in the require.config path the latest api. ("https://js.arcgis.com/3.13 ") but idk how is the structure in the require to call all the functions that i need to use the examples showed in the samples website for arcgis for js. Ex: Create a map | ArcGIS API for JavaScript The thing is i dont want to put the require in the same webpage, so im using the structure how the attachment shows. My html just have this in the head. <script src="js/require.js" data-main="js/main"></script> My main.js file is something like: require.config({
paths: {
'esri': 'https://js.arcgis.com/3.13'
}
});
require(['order!jquery','esri','esri/Map', "dojo/domReady!"], function ($, Map) {
}); What im doing wrong or missing? Thanks for all ur help as always
... View more
05-13-2015
08:46 AM
|
0
|
10
|
14739
|
| 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
|