Closed slead closed 4 years ago
You can set this up in your application using the copy-webpack-plugin.
Maybe something like this.
/*
Add a /public folder to the root of your project, and place images in it.
*/
// webpack.config.js
new CopyPlugin([
{ from: 'public', to: '.' }
]),
Then you can use it like this.
view.graphics.add({
attributes: {},
geometry: {
type: 'point',
latitude: 34,
longitude: -118,
},
symbol: {
type: 'picture-marker',
url: './my-image.png', // like this
width: 46,
height: 46,
},
});
Description
A
PictureMarkerSymbol
has a URL property, which points to the location of a suitable image, egsymbol.url = "cat-1-hurricane.png";
How can a PictureMarkerSymbol's URL be set with webpack?
https://github.com/Esri/arcgis-webpack-plugin/issues/69#issuecomment-552406286 has an example where the URL is set as a Base64 image:
How can I go from something like `./assets/images/cat-1-hurricane.png' to that? Thanks