|
POST
|
I know it can seem a little odd. There are checks in Accessor for when properties are set where we do something like this; target instanceof Clazz. When the origin of the modules is different, this is false and fails. It's part of the internal API. One solution would be to treat shared libs from the shell like workers. You can't pass class instances to workers, only data objects, like objects, arrays, buffers, etc. So you could use some of the toJSON() and fromJSON() methods of classes to pass data back and forth. But, I'll try to keep a mental note for this thread as we do more research in federated modules. Thanks!
... View more
12-30-2021
09:50 AM
|
0
|
0
|
7320
|
|
POST
|
Ah you're right. I was able to pan around and stuff, but the Locate breaks things. I still think it's weird that it breaks like in the shared lib, even though it's not instantiating classes in the main app. As to the why... This boils own the prototype chain. Most classes in the API are subclasses of the Accessor. So what happens in the case of federated modules, if the shell app creates a Graphic instance, and passes that to the shared lib, the Accessor in the chain is a different origin, which causes the error. Federation is working as expected, the shared lib has a build of the API, the shell has its own build, but the two don't share the same prototype chain. My recommendations so far when using federated modules is to create a shared lib that exposes factory methods to do the API specific work, exposes components with the API, and the shell doesn't need to worry about instantiating API stuff. We are currently doing some internal testing in the area, but nothing concrete at the moment.
... View more
12-29-2021
08:15 AM
|
0
|
2
|
7332
|
|
POST
|
There's a pending PR here, but being the end of the year, I'm guessing the maintainer is on vacation. It doesn't really need the PR though, you can configure esri-loader a couple of ways to the version you want. https://github.com/Esri/esri-loader#configuring-esri-loader
... View more
12-29-2021
08:06 AM
|
1
|
0
|
1278
|
|
POST
|
Clustering isn't supported in GraphicsLayer. You can add your features to a client-side FeatureLayer with featureReduction. Here's a sample https://codepen.io/odoe/pen/vYepwwR?editors=1000
... View more
12-28-2021
12:23 PM
|
1
|
0
|
1496
|
|
POST
|
This is odd. That error means the instance of the SpatialReference is not from the same install of the API as the rest of the classes. This can happen when you mix CDN API classes with local ESM API classes for instance. I'm able to build your app and see the error, but in my case, the map and buttons still all work. You don't seem to use arcgis/core in the shell, just the component stuff. This error could happen if your shared component, at host :3001 uses the API, then your app at host :3002 use the API. Even though these are the same version of the API, they come from different sources via the ports, so they don't match up. I've done some work with webpack module federation before, but not with Angulars tooling for it. If you are not loading API code from your main app shell, and only the component, it might be with the angular/webpack tooling. I made a vanilla version of your map service and home button here. https://github.com/odoe/arcgis-jsapi-federated I don't see the same error though.
... View more
12-28-2021
08:42 AM
|
0
|
4
|
7347
|
|
POST
|
You can get more specific. with the css. This works. article.esri-popup__content {
font-size: 14px;
font-weight: 500;
}
... View more
12-23-2021
12:03 PM
|
1
|
0
|
4167
|
|
POST
|
If you only want the individual layers, is there a reason you don't add them as FeatureLayers? Doing multiple layers from the same map service means multiple image requests instead of one, so would be less efficient.
... View more
12-23-2021
08:20 AM
|
0
|
1
|
1292
|
|
POST
|
Since you're already using the API, urlUtils would probably be the simplest route.
... View more
12-23-2021
08:12 AM
|
0
|
2
|
4700
|
|
POST
|
If you need multiple lines, you can add a "<br>" or "<p>" tags.
... View more
12-22-2021
02:45 PM
|
0
|
1
|
2221
|
|
POST
|
You can do this with a custom source where you override the "getSuggestions()" method. https://codepen.io/odoe/pen/oNGGZpY?editors=1000 return results.data.features.map((feature) => {
return {
key: "name",
// HTML in return text
text: `<span class="my-suggest"><i>${feature.properties.label}</i></span>`,
sourceIndex: params.sourceIndex
};
});
... View more
12-22-2021
01:44 PM
|
0
|
3
|
2227
|
|
POST
|
I don't think there's a setting for this. You can add some CSS to accomplish this. .esri-search_container {
flex-direction: row-reverse;
} This moves the arrow when there are multiple sources too, so keep that in mind.
... View more
12-22-2021
07:48 AM
|
1
|
0
|
798
|
|
POST
|
This functionality is already built into the browser. https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams const params = new URLSearchParams(window.location.search)
const myParams = {}
for (let key of params.keys()) {
myParams[key] = params.get(key)
} We also have a util in the API that can help too. https://developers.arcgis.com/javascript/latest/api-reference/esri-core-urlUtils.html#urlToObject const { query } = urlUtils.urlToObject(window.location.href) Now you can use your URL parameters to write a query or navigate to a coordinate, create definition expressions, whatever floats your boat.
... View more
12-22-2021
07:31 AM
|
1
|
4
|
4716
|
|
POST
|
Your useEffect needs a little tweaking. You need to return the cleanup method inside the useEffect or the container is never set to null. useEffect(() => {
if (elRef.current) {
view.container = elRef.current;
}
// clean up code run when route changes
return () => {
view.container = null
}
// be sure to let effect watch the ref
// so it doesn't get away from you
}, [elRef])
... View more
12-20-2021
10:17 AM
|
1
|
1
|
1903
|
|
POST
|
Are you implementing the backend API for the GeoJSON? When you say it can grow over time, I assume it's pulled directly from a backed db. The only thing you can really do in this case is to enhance your API to do some filtering, maybe by extent or other fields. You can pass custom parameters for something like this. If it were a static file, there are some caching options depending on your platform, but at the end of the day, 90mb is 90mb, so your best option is to enhance your backend API. For reference, you can look at how USGS built their API for various formats and filter parameters. https://earthquake.usgs.gov/fdsnws/event/1/#parameters
... View more
12-16-2021
09:10 AM
|
1
|
0
|
2419
|
|
POST
|
I don't know how you're updating it, but you can just update the href of the link tag. let theme = "dark";
btn.addEventListener("click", () => {
if (theme === "light") {
sheet.href = "https://js.arcgis.com/4.22/esri/themes/dark/main.css";
theme = "dark";
} else if (theme === "dark") {
sheet.href = "https://js.arcgis.com/4.22/esri/themes/light/main.css";
theme = "light";
}
}); https://codepen.io/odoe/pen/qBPaPpR?editors=1000
... View more
12-10-2021
08:56 AM
|
1
|
3
|
4383
|
| Title | Kudos | Posted |
|---|---|---|
| 2 | Wednesday | |
| 1 | 3 weeks ago | |
| 2 | 2 weeks ago | |
| 2 | 05-19-2026 02:12 PM | |
| 1 | 04-24-2026 11:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|