|
POST
|
Last ditch effort to find someone who knows... These are steps I have taken to get me to where I am. Export JSON from web map Use Python to turn web map into APRX using a layout with 2 map frames. The MainMapFrame gets all the layers from JSON.including graphics created in web map. The other map frame gets layers as declared in layout template. Now, I'd like to copy one of the graphics layers from MainMapFrame to the other mapframe. So that I can print it all to PDF. Nothing has worked so far. I even tried this: myLayer = map1.listLayers('myLayer')[0]
myLayer.saveACopy(r"...\myLayer.lyrx")
map2.addLayer(arcpy.mp.LayerFile(r"...\mylayer.lyrx")) Both map frames have same spatial reference and share other common service layers that display without any issues. Must be something about graphics.
... View more
11-05-2020
12:11 PM
|
0
|
0
|
2317
|
|
POST
|
Wanted to add a little more context in the hopes of garnering some feedback. Using ConvertWebMapToArcGISProject to create a map. Now as part of the JSON, I'm ending up with a graphics layer. It looks something like this: {
"mapOptions": {
...
},
...
},
"operationalLayers": [
{
"id": "defaultBasemap",
...
},
{
"id": "<map servce name>",
....
},
{
"id": "<mygraphicslayer>",
"opacity": 1,
"minScale": 0,
"maxScale": 0,
"featureCollection": {
"layers": [
{
"layerDefinition": {
"name": "pointLayer",
"geometryType": "esriGeometryPoint"
},
"featureSet": {
"geometryType": "esriGeometryPoint",
"features": [
{
"geometry": {
"x": someX,
"y": someY,
"spatialReference": {
"wkid": 102100
}
},
...
}
]
}
}
]
}
}
]
} I can remove <mygraphicsLayer> from map by doing mymap.removeLayer(mymap.listLayers("pointLayer")[0]
But I can't add this "pointLayer" to another map (see my first post). Is there any way to grab a portion of the JSON above... json.loads(Web_Map_as_JSON)['operationalLayers'][2] to define a layer and add it to another map? Such as ... json.loads(Web_Map_as_JSON)['operationalLayers'][2]["featureCollection"]["layers"][0] # doesnt seem to work ... or get some viable layer definition that can be fed into ... arcpy.JSONToFeatures_conversion() ... and then add those to the other map?
... View more
11-04-2020
10:15 AM
|
0
|
1
|
2317
|
|
POST
|
This was terrific. I had a series of queries to make and was using a loop. I had a heckuva time trying to get to sense of all my callbacks completing at different times. Welcome to async hell. On a side note, I played some - only half successfully - with async/await before finding dojo/promise/all - is it true that this is a bad approach with the JSAPI ? Came across some post warning against it.
... View more
11-02-2020
03:55 PM
|
0
|
0
|
4035
|
|
POST
|
Trying to get a graphics layer that was created from JSON (using the whole webmap to JSON workflow) from one map in APRX to another map using arcpy. I've tried this: myLayer = map1.listLayers("myLayer")[0]
map2.addLayer(myLayer)
map2.listLayers() The layer now shows up in the layer list. But I can't see it in the map. So I tried this: layerDef = json.loads(Web_Map_as_JSON)['operationalLayers'][<index of layer>]
map2.addLayer(map1.listLayer("myLayer")[0]
map2.listLayers("myLayer")[0].updateLayerFromJSON(layerDef)
Everything runs without errors. I just don't get the added layer to display. Any suggestions?
... View more
11-02-2020
03:13 PM
|
0
|
2
|
2362
|
|
POST
|
Never tried any of this but here is more on customization... Customize popup | Guide | ArcGIS API for JavaScript 3.34
... View more
10-22-2020
01:21 PM
|
0
|
0
|
3334
|
|
POST
|
The article is pretty old but there is more general info on this page as well: Popup | ArcGIS API for JavaScript 3.34 if you're suing 3.x.
... View more
10-22-2020
10:28 AM
|
0
|
1
|
3334
|
|
POST
|
Take a look at this article on how to style popups using CSS. Making Your Pop-up Pop! It shows example like this. .esriPopup.modernGrey {
font-size: 12px;
}
... View more
10-22-2020
10:23 AM
|
0
|
2
|
3334
|
|
POST
|
Vakhtang - Are you working with Web AppBuilder or are you creating a standalone web application using the Javascript API?
... View more
10-22-2020
07:40 AM
|
0
|
4
|
3334
|
|
POST
|
Michel. I'm no expert at this... I'm constantly relying on feedback from folks like Robert around here. I would try replacing... this.tabContainer = new TabContainer ({
...
selected: this.selTab}
...) with this.tabContainer = new TabContainer ({
...
selected: "Tab 1"}
...)
... View more
10-22-2020
06:56 AM
|
0
|
0
|
1378
|
|
POST
|
Oh my! It's the jungle out there... I started with "dijit/layout/TabContainer" ...based on the earlier examples in this thread... then I got to churning through online examples and ended up trying to get it work with... "jimu/dijit/TabContainer" ... somewhere along the way, I also played with ... "jimu/dijit/TabContainer3" I've tossed them all and am using a pure HTML/CSS/JS solution that I understand and that gives me full control over events and enabling/disabling tabs. I'll post an example when I'm done. In this case, jimu/dojo was too much overhead for me to take the time and decipher. Thanks again for your efforts. Maybe one day in our post-Covid days, I'll get the chance to buy you a drink at an ESRI event!
... View more
10-16-2020
01:19 PM
|
1
|
0
|
1378
|
|
POST
|
Okay, so I realized that I had it in startup()... no idea what's going here. But I really don't think I have the time to code around all these dojo quirks. Dojo seems to get in the way of getting stuff done all the time. I'll go back to trying a basic n HTML/css tab container.
... View more
10-16-2020
09:47 AM
|
0
|
4
|
1548
|
|
POST
|
Great suggestion! Think I've had about enough of dojo... I'm replacing all my button's in my latest widget with simple buttons. Great example that can be made to look almost like existing dojo button and comes without all the themes/CSS headaches is here - Edit fiddle - JSFiddle - Code Playground.
... View more
10-16-2020
08:26 AM
|
0
|
0
|
3558
|
|
POST
|
I know, I know... I did that months ago - about the time you started answering my first helpless cries for expertise. I've learned a few tricks since then. That ESRI page is alright. As usual, they could do better though.
... View more
10-16-2020
08:23 AM
|
0
|
0
|
1548
|
|
POST
|
Interesting.... let me try and move it to startup(). -- Any useful guidance as to what elements of your code should live where in the lifecycle? I have often wonder. I figured that many of not most of my function, especially if they don't really interact with DOM and layout could be defined early. I once had some event handlers living in open() and was told you'd end up with a bunch new ones each time that widget was opened, which could lead to memory leaks. But still I never really have though about it further. Maybe stuff for another post. Let me try what you suggested.
... View more
10-16-2020
07:50 AM
|
0
|
2
|
1548
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-16-2025 07:32 AM | |
| 1 | 02-09-2024 05:18 PM | |
| 1 | 02-04-2025 09:27 AM | |
| 1 | 03-22-2019 10:55 AM | |
| 1 | 03-05-2020 08:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|