Wednesday, March 28, 2018

Arcgis REST API Append Data to Feature Layer

I needed to append data to an existing Hosted Feature Layer with multiple layers. I found that I was able to append the data by submitting a JSON request, but the data I was adding never showed up on the map. I found a few suggestions such as doing a refresh via javascript on the layer or turning off synchronization which I did. It turns out is was an issue with the data I was submitting.
I added the data at first using the addFeatures and then I tried the applyEdits...both worked fine. I could see the data in the Data tab online but not in the map.
The request looked like this:
[{
'attributes' : {
'fieldName1' : 'junk data',
'latitude': 89.1000,
'longitude' : -119.333
}
}]
For some reason, I thought that the Lat/Long included in the attributes was how the original data was being mapped, so in reading the instructions, I ignored the Geometry part of the request, which ended up being my problem. I had to submit the request like this:
[{
'geometry' : {'x' : -119.333, 'y' : 89.1000},
'attributes' : {
'fieldName1' : 'junk data',
'latitude': 89.1000,
'longitude' : -119.333
}
}]
Mind your {} and [] and ,,,, and data types and you should be good :)

Tuesday, March 27, 2018

Eclipse XDebug Stuck at 78%

This error seems to happen out of no where. It usually happens when I move to a new PC or something. A lot of times it is the config settings for XDebug buried in the php.ini file. Of the many issues that can cause this error, I did find one simple solution that was causing my problem when I recently moved to a laptop: The difference? C drive vs D drive. This caused all sort of issue because I had to change the drive letter to get the entire PHP/APACHE/Eclipse/MySQL thing going but I also found that inside Eclipse I was pointing the External Browser for debug to D:\Program Files\Mozilla Firefox\firefox.exe.
To check your settings, go to Window - Preferences - General - Web Browser, click the browser type and then click Edit. Verify this path is correct.