POST
|
Hi all, Is it possible to customize the story map so on button click we hide/show sections. I would like to filter the story maps. I dont really want to embed story maps within that story map. Thanks, Alex
... View more
03-01-2018
09:57 AM
|
0
|
1
|
141
|
POST
|
Yeah, I got something working here: import urllib , urllib2 , json , time , datetime , os , fnmatch , zipfile , arcpy , sys , logging , tempfile , shutil , glob , re pattern = '*.zip' gdbextension = '*.gdb' logging . basicConfig ( filename = r "\\arcgisserver\cronjobs\stormwater\backup.log" , format = '%(asctime)s %(levelname)s: %(message)s' , datefmt = '%m/%d/%Y %I:%M:%S %p' , level = logging . INFO ) username = #CHANGE password = #CHANGE replicaURL = " https://services.arcgis.com/UHg8l1wC48WQyDSO/ArcGIS/rest/services/swexporttest/FeatureServer/createReplica " #CHANGE replicaLayers = [ 0 , 1 , 2 , 3 , 4 , 5 ] #CHANGE replicaName = "replicaStormWater" #CHANGE def sendRequest ( request ) : response = urllib2 . urlopen ( request ) readResponse = response . read ( ) jsonResponse = json . loads ( readResponse ) return jsonResponse logging . info ( '..Starting process..' ) print ( "Generating token" ) url = " https://arcgis.com/sharing/rest/generateToken " data = { 'username' : username , 'password' : password , 'referer' : " https://www.arcgis.com " , 'f' : 'json' } request = urllib2 . Request ( url , urllib . urlencode ( data ) ) jsonResponse = sendRequest ( request ) token = jsonResponse [ 'token' ] print ( "Creating the replica" ) data = { 'f' : 'json' , 'replicaName' : replicaName , 'layers' : replicaLayers , 'returnAttachments' : 'true' , 'returnAttachmentsDatabyURL' : 'false' , 'syncModel' : 'none' , 'dataFormat' : 'filegdb' , 'async' : 'true' , 'token' : token } request = urllib2 . Request ( replicaURL , urllib . urlencode ( data ) ) jsonResponse = sendRequest ( request ) print ( jsonResponse ) print ( "Pinging the server" ) responseUrl = jsonResponse [ 'statusUrl' ] url = "{}?f=json&token={}" . format ( responseUrl , token ) request = urllib2 . Request ( url ) jsonResponse = sendRequest ( request ) while not jsonResponse . get ( "status" ) == "Completed" : time . sleep ( 5 ) request = urllib2 . Request ( url ) jsonResponse = sendRequest ( request ) # Create string date for today's date dt = str ( datetime . date . today ( ) ) # Create new folder with today's date newfolder = 'C:\\replicas' + "\\" + "Alex" if not os . path . exists ( newfolder ) : os . makedirs ( newfolder ) print ( "Downloading the replica. In case this fails note that the replica URL is: \n" ) jres = jsonResponse [ 'resultUrl' ] url = "{0}?token={1}" . format ( jres , token ) print ( url ) logging . info ( "Replica URL: " ) logging . info ( url ) f = urllib2 . urlopen ( url ) with open ( newfolder + "\\" + os . path . basename ( jres ) , "wb" ) as local_file : local_file . write ( f . read ( ) ) print ( "\n Finished!" ) logging . info ( "finished creating replica" ) for root , dirs , files in os . walk ( newfolder ) : for filename in fnmatch . filter ( files , pattern ) : print ( os . path . join ( root , filename ) ) zipfile . ZipFile ( os . path . join ( root , filename ) ) . extractall ( os . path . join ( root , os . path . splitext ( filename ) [ 0 ] ) ) for root , dirs , files in os . walk ( newfolder ) : for filegdb in fnmatch . filter ( dirs , gdbextension ) : print ( os . path . join ( root , filegdb ) ) pathgdb = os . path . join ( root , filegdb ) #Set up Workspace print ( "Setting workspace..." ) arcpy . env . workspace = pathgdb arcpy . env . overwriteOutput = True #Add GUID to feature class print ( "Adding GUID field..." ) arcpy . AddField_management ( "SW_CONVEY" , "GUID" , "GUID" , "" , "" , "" , "" , "NULLABLE" , "REQUIRED" , "" ) print ( "Done Adding field..." ) #Calculate field GUID print ( "Calculating GUID field..." ) arcpy . CalculateField_management ( "SW_CONVEY" , "GUID" , '!GlobalID!' , "PYTHON_9.3" , "" ) print ( "Done Calculating field..." ) # Use FeatureToPoint function to find a point inside each park print ( "Converting line to points..." ) arcpy . FeatureToPoint_management ( "SW_CONVEY" , "SW_CONVEY_PTS" , "INSIDE" ) print "Line converted to points." # Execute AddXY print ( "Adding XY field to point layer..." ) arcpy . AddXY_management ( "SW_CONVEY_PTS" ) print "XY added." # Create a feature layer from FC print ( "Create a feature layer from FC..." ) arcpy . MakeFeatureLayer_management ( "SW_CONVEY_PTS" , "SW_CONVEY_PTS_FL" ) print "Feature Layer created." # Create view from table print ( "Create view from table..." ) arcpy . MakeTableView_management ( "SW_CONVEY_ASSET_MAINT" , "SW_CONVEY_ASSET_MAINT_VIEW" , "" , "" , "" ) print "Table View created." #Add join print ( "Add Join..." ) arcpy . AddJoin_management ( "SW_CONVEY_ASSET_MAINT_VIEW" , "Convey_guid" , "SW_CONVEY_PTS_FL" , "GUID" ) print "Join created." # Copy the layer to a new table print ( "Copying Joined results to new table..." ) arcpy . CopyRows_management ( "SW_CONVEY_ASSET_MAINT_VIEW" , "SW_CONVEY_ASSET_MAINT_VIEW_TABLE" ) print "Table created." # Make the XY event layer... sr = arcpy . SpatialReference ( 102642 ) print ( "Making a point from xy table..." ) arcpy . MakeXYEventLayer_management ( "SW_CONVEY_ASSET_MAINT_VIEW_TABLE" , "SW_CONVEY_PTS_POINT_X" , "SW_CONVEY_PTS_POINT_Y" , "SW_CONVEY_ASSET_MAINT_PTS" , sr , "" ) print "XY layer Created." # Execute CreateFileGDB print ( "Creating a fgdb ..." ) arcpy . CreateFileGDB_management ( r "Z:\Agole" , "Assign.gdb" ) #Copy features print ( "Making feature class..." ) arcpy . FeatureClassToFeatureClass_conversion ( "SW_CONVEY_ASSET_MAINT_PTS" , r "Z:\Agole\Assign.gdb" , "Assignments" , "" ) print "Features are successfully copied."
... View more
02-27-2018
10:00 AM
|
0
|
1
|
16
|
POST
|
Thanks Stephen, That makes sense. I just refenced the autocomple.js in the define using 'app/jquery-ui/autocomplete', this in the custom-script.js file. Now I am getting these errors: Any idea, should it be defined somewhere else than the custom script?
... View more
02-22-2018
02:48 PM
|
1
|
0
|
51
|
POST
|
Here is what I get: Error: It seems like it is looking in arcgis javascript API for "autocomplete". Any idea?
... View more
02-22-2018
09:57 AM
|
0
|
0
|
51
|
POST
|
Looking at this site https://learn.jquery.com/jquery-ui/environments/amd/ . It seems like exactly what I need. However, I am unsure how to achieve this in a story map Journal. I would like to use it in the "custom-script.js". It is using a "define", not "require".
... View more
02-22-2018
08:52 AM
|
0
|
2
|
51
|
POST
|
I am currently using JQueryUI autocomplete to type project names and navigate to the section corresponding to that project. I have it working almost working 100% but sometimes JQuery UI does not load up. Is there a way to load it up in custom-script.js for instance? I loaded it up via index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> < html > < head > < script src = " https://code.jquery.com/ui/1.12.1/jquery-ui.js " > </ script > < script > $ ( document ) . ready ( function ( ) { var availableTags = [ { label : "Mosquito Rd" , value : "1" } , { label : "Peavine Ridge Rd" , value : "2" } , { label : "Cable Road" , value : "3" } , { label : "Grizzly Flat Road" , value : "4" } , { label : "String Canyon Road" , value : "5" } , { label : "Sciaroni Road" , value : "6" } , { label : "Fort Jim Road" , value : "7" } , { label : "Kyburz Drive" , value : "8" } , { label : "Starkes Grade Road" , value : "9" } , { label : "White Meadows Road" , value : "10" } , { label : "Pony Express Trail" , value : "11" } , { label : "Cosumnes Mine Road (Loc 1)" , value : "12" } , { label : "Cosumnes Mine Road (Loc 2)" , value : "13" } , { label : "Cosumnes Mine Road Bridge" , value : "14" } , { label : "Happy Valley Road" , value : "15" } , { label : "Sweeney Road Bridge" , value : "16" } , { label : "Tahoe Roads" , value : "17" } , { label : "Evelyn Way" , value : "18" } , { label : "Fallen Leaf Road/Tahoe Mountain Road" , value : "19" } , { label : "Lakeview Avenue" , value : "20" } , { label : "Mt. Aukum Road" , value : "21" } , { label : "Bucks Bar Road" , value : "22" } , { label : "Newtown Road" , value : "23" } , { label : "Airport Road" , value : "24" } , { label : "Green Valley Road" , value : "25" } , { label : "Lake Tahoe Boulevard" , value : "26" } , { label : "Elks Club Drive" , value : "27" } , { label : "US 50/Missouri Flat Interchange, Phase 1B2 - Class 1 Trail" , value : "28" } , { label : "US 50/Missouri Flat Interchange, Phase 1C - Riparian Restoration" , value : "29" } , { label : "Blair Road Bridge Replacement" , value : "30" } , { label : "Ice House Road and Jones Fork Bridge Rehabilitation" , value : "31" } , { label : "Green Valley Road at Weber Creek Bridge Replacement" , value : "32" } , { label : "Meyers Stream Environment Zone/Erosion Control Project" , value : "33" } , { label : "Diamond Springs Parkway, Phase 1A" , value : "34" } , { label : "New York Creek Class 1 Trail, Phase 2" , value : "35" } , { label : "Sly Park Road at Clear Creek Bridge Replacement" , value : "36" } , { label : "Silver Fork Road Bridge Rehabilitation" , value : "37" } , { label : "El Dorado Trail - Los Trampas to Halcon" , value : "38" } , { label : "Silva Valley Parkway - Class 1 and 2 Bike Trails" , value : "39" } , { label : "Francisco Drive/Schooner Way ADA Improvements" , value : "40" } , { label : "Elks Club Drive Overlay" , value : "41" } , { label : "Country Club Heights Erosion Control Project" , value : "42" } ] ; $ ( "#tags" ) . autocomplete ( { source : availableTags , select : function ( event , ui ) { event . preventDefault ( ) ; $ ( "#results" ) . val ( ui . item . value ) $ ( "#tags" ) . val ( ui . item . label ) ; } } ) ; } ) ; </ script >
... View more
02-08-2018
10:48 AM
|
0
|
4
|
51
|
POST
|
I m trying to use the autocomplete function in storymap journal but I cannot figure out where to add the script. Any idea?
... View more
02-07-2018
09:07 AM
|
0
|
8
|
277
|
POST
|
I got it to work. My layer ID was wrong, instead of UNHCR_PoC_2016_8102 I entered this UNHCR_PoC_2016_8102_layer.
... View more
01-24-2018
08:39 AM
|
1
|
0
|
27
|
POST
|
Hi all, I would like to skip to the corresponding section by clicking on feature in a web map. I am trying to achieve this https://developerscorner.storymaps.arcgis.com/navigate-map-journal-sections-using-the-mainstage-map-ab827a105d0c . I followed step by step the instructions and I got nothing. Cooper Thomas. This is not working for me. Any idea? Here is the link: http://gem.edcgov.us/journal/ Thanks, Alex
... View more
01-23-2018
01:11 PM
|
0
|
1
|
186
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|