POST
|
Does anyone know of a way to set FieldInfo or some kind of field formatting properties on the fields displayed in a search widget suggestion template? I really just need to set digitSeparator: false on a lengthy numeric ID field that the suggestion template is adding digit separators to. This appears to be due to the search widget changes introduced in the 4.12 API. Any help would be much appreciated!
... View more
04-29-2020
10:50 PM
|
0
|
0
|
322
|
POST
|
Hey Tyler, I did figure out a solution, though I am not super confident this approach is considered best practice. I simply export the store after it's created in index.js, and import it from index.js into my popup component and pass it to the popup tree's <Provider>. So index.js looks like this: ... export const store = configureStore() const render = () => ReactDOM.render( <AppContainer> <Provider store={ store }> <App history={ history } /> </Provider> </AppContainer>, document.getElementById('root') ) render() ... and my popup component looks like this: import React from 'react' import ReactDOM from 'react-dom' import StreamPopup from '../../containers/StreamPopup' import { Provider } from 'react-redux' import { store } from '../../index' const buildPopup = () => { let popupNode = document.createElement('div') ReactDOM.render( <Provider store={ store }> <StreamPopup /> </Provider>, popupNode ) return popupNode } export default buildPopup I had trouble finding any recommendations online about the best way to do this, which was a little surprising given the fact that multiple React trees in the same app are quite common and Redux is so widely used. One thing I would be a little wary of with this approach are race-conditions (if two React trees are 'racing' to change the same state props at the same time). Maybe you'll have better luck than me finding a definitive solution? If you do, let me know!
... View more
03-20-2019
12:40 PM
|
1
|
1
|
2823
|
POST
|
Hey Tyler - I had a similar need and your code above was extremely helpful. Thank you! One follow up question though: were you using Redux? I am new to Redux and am trying to connect my popup content component to my app's store, but I'm confused as to how you share the store across components that don't share the same root. When I first call ReactDOM.render() I wrap the root of my app with redux-react's <Provider> component and pass in the store, so all of it's child components have access to the store. But because the popup content doesn't fall within the App's hierarchy and is rendered with it's own ReactDOM.render() call, it doesn't know about the store. If you or anyone else has thoughts on how to provide access to a Redux store across multiple independent React component hierarchies, let me know!
... View more
02-19-2019
03:13 PM
|
0
|
3
|
2823
|
POST
|
I think I answered my own question. For anyone interested, it's perfectly acceptable to render react components using reactDOM.render() right in the popup's DOM node. Here's an example of that, and an explanation in React's docs confirming that that's a valid approach. I'm new to React and didn't know this, but to quote the docs, "Although React is commonly used at startup to load a single root React component into the DOM, ReactDOM.render() can also be called multiple times for independent parts of the UI which can be as small as a button, or as large as an app. In fact, this is exactly how React is used at Facebook."
... View more
02-12-2019
04:48 PM
|
0
|
0
|
757
|
POST
|
Hey there, I'm curious whether you ended up re-writing the popup from scratch or whether you were able to leverage the popupViewModel. I'm in a similar situation... I'd love to use a react component to render the popup content but I'd prefer not to lose the ESRI out-of-the-box popup positioning logic. Any advice you might have would be much appreciated!
... View more
02-12-2019
11:24 AM
|
0
|
1
|
757
|
POST
|
Jayakumar Kamalakkannan, did you ever figure out a solution to this? I'm experiencing the same thing in IE 11.
... View more
07-16-2018
05:25 PM
|
0
|
0
|
359
|
POST
|
FYI - I reached out to Esri support and they confirmed that arcade expressions are not supported on MapImageLayer sublayers. More info here: Sublayer | API Reference | ArcGIS API for JavaScript 4.7
... View more
07-03-2018
10:22 AM
|
1
|
0
|
397
|
POST
|
Hi all - I'm having trouble getting a popup for a MapImageLayer sublayer to evaluate an arcade expression I set in the expressionInfos property of the popup template. It works fine if I load the layer as a FeatureLayer, but it does not seem to work if I load it as a MapImage Layer. Does that popupTemplate feature simply not work for MapImageLayers? My popupTemplate is below: popupTemplate: { title: 'Other Tracts', content: '<ul><li><strong>Tract Name:</strong> {TRACTNAME}</li>' + '<li class=\'{expression/check-othername}\'><strong>Other Name:</strong> {OTHERNAME}</li>' + '<li><strong>Conservation Priority:</strong> {TIER}</li>' + '<li><strong>Site Name:</strong> {SITENAME}</li>' + '<li><strong>Plan Name:</strong> {PLANNAME}</li>' + '<li><strong>Plan URL:</strong> {PLANURL}</li>' + '<li><strong>Comments:</strong> {COMMENTS}</li>', fieldInfos: [{ fieldName: 'PROTDATE', format: { dateFormat: 'short-date' } }], expressionInfos: [{ name: 'check-othername', expression: "if($feature.OTHERNAME == NULL){return 'invisible'}" }] }
... View more
06-27-2018
10:48 AM
|
0
|
1
|
593
|
POST
|
Jay, did you ever figure out a solution to this for MapImageLayer? I also would like to simulate a click on a mapImageLayer feature...
... View more
05-24-2018
02:49 PM
|
0
|
1
|
492
|
POST
|
Does anyone have any advice for how to fire a click event programmatically in the 4.x version of the API? It looks like the map.event method is no longer available. My goal is to be able to select a feature on a MapImageLayer programmatically, and have it's corresponding popup display as if it had been clicked. Any thoughts would be much appreciated!
... View more
05-23-2018
10:44 AM
|
0
|
0
|
552
|
POST
|
Hello, I'm experiencing the same issue: on 4.7, using a custom elevation layer (as described here), the search widget does not navigate to the search result location. You can test by adding a search widget to the sandbox code. If you replace the custom elevation layer with "world-elevation" as the value for the 'Ground' property in the map, the search widget will work as expected. Has a bug been filed for this issue? Best, Nathaniel
... View more
05-14-2018
10:31 AM
|
0
|
0
|
160
|
POST
|
I see, and yes that does make sense. Thanks so much for your help Undral!
... View more
04-23-2018
12:14 PM
|
0
|
0
|
417
|
POST
|
Hi Undral, My mistake - I should have given you a different endpoint to use. It appears as though the Layer List widget will honor sublayer scales if the parent layer has either min or max set, as is the case with the Flowlines. However, I just swapped that URL out in your codepen example for this one: NHDPlus_NP21/WBD_NP21_Simplified (MapServer) (Note, max scale and min scale both set to 0 on the parent layer, but specified in all sublayers), and the layer list widget does not seem to respect the visibility ranges of the sublayers. Let me know if you're seeing that too.
... View more
04-19-2018
09:26 AM
|
0
|
3
|
417
|
POST
|
Ah, you're right Undral, if I set the max/min Scale on the sublayer manually when I request the MapImageLayer the app does respect them and the layers get gray-ed out appropriately. However, the sublayer does not seem to automatically retrieve and respect the default max and min scales set on the endpoint (e.g., Layer: Flowlines (ID: 0) ). Is that expected behavior?
... View more
04-18-2018
02:19 PM
|
1
|
7
|
1028
|
POST
|
Hey Robert! Unfortunately, I have tried switching to 4.7 and I'm still experiencing the issue.
... View more
04-18-2018
12:02 PM
|
0
|
1
|
1028
|
Title | Kudos | Posted |
---|---|---|
1 | 04-18-2018 02:19 PM | |
1 | 03-20-2019 12:40 PM | |
1 | 07-03-2018 10:22 AM |
Online Status |
Offline
|
Date Last Visited |
02-16-2021
11:40 AM
|