POST
|
I'm wondering if it's possible to add a script tag to a custom popup in ArcGIS Online. It seems like I can add html tags but script tags just disappear. As an example. If I configure a popup for a layer and choose 'custom attribute display', I can view the html source. If I add the code below, cof_div0 shows up fine but the script never runs to populate cof_div1. <div id="cof_div0">This is div 0</div> <div id="cof_div1"></div> <script>document.getElementById("cof_div1").innerHTML = "Hello World"</script> If the above is not possible, does anyone know how I can customise popups with javascript. I need to calculate the date something is going to happen based on a couple of attributes from the layer. Thanks,
... View more
09-01-2016
01:49 AM
|
0
|
2
|
2407
|
POST
|
Hi Robert, thanks for the response. Unfortunately, I am not using the Developer Edition I'm using the Web AppBuilder that is integrated into ArcGIS Online. I don't think there is any way to add a proxy to that service. I think the problem lies with the Near Me Widget. I have the Directions Widget and it works fine for users that are not logged-in but the directions tab in the Near Me widget does not work even though they use the same routing service. Danik
... View more
07-24-2016
07:52 PM
|
0
|
1
|
386
|
POST
|
I've created a web app in AGOL which uses the Near Me widget. The widget is also setup to use the default World Routing service. I put the routing url in the premium services section of the Attributes tab which I assume means that anyone can use the service. The problem is when an anonymous user who is not logged in to AGOL uses the widget they are redirected to log in. I would like to avoid this if possible, any suggestions? Thanks,
... View more
07-20-2016
08:16 PM
|
0
|
3
|
2107
|
POST
|
I seem to be running into some issues migrating my code from 10.0.4 to 10.2. Here is an example of code that is causing some issues. Sub CreateSquare
Dim objSmpSqr, siteID, sqrID, nEast, nNorth, sizeX, sizeY, myRect
'Assigning values to variables
siteID = "Trial"
sqrID = 1
nEast = 389900
nNorth = 6446055
sizeX = 5
sizeY = 5
'Calcualting rectangle extent
Set myRect = Application.CreateAppObject("rectangle")
myRect.Left = nEast
myRect.Right = nEast + sizeX
myRect.Top = nNorth
myRect.Bottom = nNorth - sizeY
'Creating feature
Application.Map.Layers("Sample Squares").Editable = True
Application.Map.AddFeature myRect, False
'Assigning values to attributes
Set objSmpSqr = Map.SelectionLayer.Records
objSmpSqr.Bookmark = Map.SelectionBookmark
objSmpSqr.Fields("SITE_ID").Value = siteID
objSmpSqr.Fields("Square_ID").Value = sqrID
objSmpSqr.Fields("EASTING").Value = nEast
objSmpSqr.Fields("NORTHING").Value = nNorth
objSmpSqr.Fields("Area_m2").Value = myRect.Area
objSmpSqr.Fields("SizeX").Value = sizeX
objSmpSqr.Fields("SizeY").Value = sizeY
objSmpSqr.Update
'Cleanup
Application.Map.Layers("Sample Squares").Editable = False
Application.ExecuteCommand("clearselected")
Set objSmpSqr = Nothing
Set myRect = Nothing
End Sub In 10.0.4 the above code works fine, creating the feature and writing the values to the attributes. In 10.2, the feature is created properly but none of the values are assigned to the attributes. The feature has blank attributes. Anyone know what has changed? Thanks,
... View more
09-08-2013
08:12 PM
|
0
|
1
|
781
|
POST
|
Thanks Thai, I figured it had something to do with that. I do find it strange though, that I can't manipulate the symbology of a layer directly through the Map object. I guess what I'll do is create a bunch of dummy apl's and keep them stored on the devices, then whenever I need one I'll just copy and rename it. Thanks again.
... View more
05-16-2013
06:25 PM
|
0
|
0
|
210
|
POST
|
I can't seem to figure out how to manipulate a layers symbology using VBscript. In my code below I'm creating a new polyline shapefile and then adding it to the map (along with a new feature). I want to set a specific colour for this layer, how would I go about doing so? Set TrackRS = CreateAppObject("recordset") lnShape = Preferences.Properties("DataPath") & "\TracksShape\TrackLog" & TrackDte & ".shp" TrackRS.Create lnShape, 3, Application.Map.CoordinateSystem TrackRS.Fields.Append "Length", 5 Set TrackShape = Map.AddLayerFromFile(lnShape) If TrackShape Is Nothing then exit sub TrackShape.Editable = true TrackShape.Records.AddNew ln TrackShape.Records.Update Map.Extent = TrackShape.Extent Map.Refresh True Thanks,
... View more
05-15-2013
08:42 PM
|
0
|
2
|
2083
|
POST
|
The fact is, rugged PDAs aren't as necessary as many people think. It all depends what environment you're working in. If you're working in an urban area and all you're doing is getting out of the car to collect a few points I completely agree with you but that's certainly not my situation. My field teams work in the Australian bush for two weeks straight putting in 10-12 hours a day. The PDA's take a beating; their constantly being dropped, people slip and use them to brace their fall, not to mention the dust and the +50 degree heat. I don't think we have any option but to use rugged PDA's. However, Trimble's new Juno now comes in an Android version 🙂 Trend setting I predict.
... View more
08-30-2012
11:46 PM
|
0
|
0
|
1596
|
POST
|
If you're in the field and only have access to your Juno I don't think there is much you can do. From what I know if you create a new map or quick project it will default to WGS84. If you have ArcPad installed on a PC, you can choose a different map projection when you create a quick project, it should let you choose something other than the default WGS84. Just navigate to the projection folder and choose GDA94 MGA55; the path should be ArcGIS\ArcPad10.0\Coordinate System\Projected Coordinate Systems\National Grids\Australia. Also, if your working from ArcMap, just export your map using the ArcPad tool and the projection will be maintained. Fyi, if all you're after are the grid coordinates you can show them even if your map projection is in WGS84. If you tap the status panel and go to the data page, you can change the coordinates displayed by tapping on them and choosing UTM. Danik
... View more
08-12-2012
10:38 PM
|
0
|
0
|
501
|
POST
|
Hey Rolf, 10 000 lines of code! I should be good for a while 😉 That's an awesome snippet of code, thanks! I've put it in my little vault.
... View more
07-16-2012
05:36 PM
|
0
|
0
|
244
|
POST
|
Just wondering if anybody has come across any issues using very large vbs scripts? Mine is just about to top 1000 lines and it got me wondering if I should be concerned. I may be wrong but as far as I can figure out you can only have 1 script per applet, is this correct? Thanks
... View more
07-12-2012
08:05 PM
|
0
|
2
|
783
|
POST
|
I agree, it would be nice to have a good GIS software for my smart phone. However, I would never send out a team in the field to do data collection with an IPhone or a Galaxy tablet. We would end up having to replace the units every week. As long as Trimble and Handheld keep making field computers running Windows mobile I think we're stuck with ArcPad the way it is.
... View more
04-14-2012
06:34 PM
|
0
|
0
|
1596
|
POST
|
Hey Rolf, Great Suggestion, it worked beautifully. I did have to make a few changes to the code to ensure variables maintained their values once the form was restarted but it all seems to be working good. The field teams will be happy! Here's a short snippet of how I got it to work:
Option Explicit
Dim g_bAlreadyOpened, XCoord, YCoord
g_bAlreadyOpened = False
Sub OnLoadForm
If g_bAlreadyOpened = False Then
XCoord = Application.GPS.X
YCoord = Application.GPS.Y
g_bAlreadyOpened = True
End If
Applet.Forms("T1").Pages("Page1").Controls("Easting").Value = XCoord
Applet.Forms("T1").Pages("Page1").Controls("Northing").Value = YCoord
End Sub
Sub OnUnloadForm
If g_bAlreadyOpened = True Then
XCoord = Applet.Forms("T1").Pages("Page1").Controls("Easting").Value
YCoord = Applet.Forms("T1").Pages("Page1").Controls("Northing").Value
Applet.Forms("T1").Show
End If
End Sub
Sub OnCancelForm
g_bAlreadyOpened = False
End Sub
When the form first starts up controls 'Easting' and 'Northing' are populated based on their respective GPS coordinates but since the field teams frequently change the values (because the don't want to stand in a river for example) I had to make certain that any changes would follow through when the form is re-initialized from the OnLoadForm event. By re-assigning variables XCoord and Y Coord before .Show, any changes made will follow through. Thanks,
... View more
03-27-2012
08:18 PM
|
0
|
0
|
371
|
POST
|
Hey Matthew, Thanks for the suggestion. I had thought of doing this and I think at one time I did have it setup up this way but unfortunately it won't really work now. I have quite a lot of things happening during the onLoad event and forcing the form to reopen all the time would probably mess things up. I was hoping that someone had a magic trick up their sleeves to prevent the OK button from closing the form. If I can't find a way I may have to use your suggestion and rework my code; Pain. Thanks,
... View more
03-26-2012
07:27 PM
|
0
|
0
|
371
|
POST
|
I need to prevent the OK button from shutting the form or I need a way to get rid of the OK button all together. Anyone have any ideas? Here's the scenario. The field teams collect data for multiple artefacts at one location. I have it setup so that they can push a button and the data is written to a shapefile and the form is refreshed without closing so they can keep entering the next artefact without opening the form all over again. The problem of course is that they on occasion hit the ok button instead which closes the form and then they have to re-open it. The problem I'm facing is that I can't use any of the onValidation calls because technically everything should pass validation in order for the data to get written. I can't figure out how to get everything to pass validation then write all the data and then prevent the form from closing. Any help would be appreciated. Thanks,
... View more
03-22-2012
08:41 PM
|
0
|
5
|
1201
|
Online Status |
Offline
|
Date Last Visited |
09-26-2022
11:43 PM
|