Hi,
I upgraded from 4.5 to 4.11, now PictureMarkerSymbol is not showing on the map, it's a client-side feature map, I confirmed my IIS is CORS enabled, and I even tried with esri image like this:
symbol = {
type: "picture-marker",
// url: this._getAQHIIcon(attributes.AQHI),
url:
contentType: "image/png",
width: 24,
height:36
};
still not working, I didn't set render for this feature layer, the image is selected from a list of icons based on an attribute value. Now it just shows dots. Could anyone please help out? This issue already took me days. Below is my code for feature layer:
featureLayer = new FeatureLayer({
fields: this.config.layerDefinition.fields,
objectIdField: this.config.layerDefinition.objectIdField,
geometryType: "point",
id: this.config.layerId,
source: this._generateGraphics(this.config.view.zoom),
popupTemplate: ({
title: "{CommunityName}" + " - Air Quality Health Index",
content: "{AQHI:getCommunityAqhiPopupContent}"
} as any) as PopupTemplate
});
_generateGraphics(zoomLevel: number): Array<Graphic> {
let graphics = this.allCommunityAqhis.map((data: any, i: number) => {
if (data.Longitude && data.Latitude) {
return this._createCommunityAqhiGraphic(data, i, zoomLevel);
}
}) as Array<Graphic>;
return graphics;
}
_createCommunityAqhiGraphic(data: any, objectId: any, zoomLevel: number) {
let point, attributes, symbol;
point = WebMercatorUtils.geographicToWebMercator(
new Point({
x: data.Longitude,
y: data.Latitude
})
);
symbol = {
type: "picture-marker",
// url: this._getAQHIIcon(attributes.AQHI),
url:
contentType: "image/png",
width: this.config.iconWidth,
height: this.config.iconHeight
};
return new Graphic({
geometry: point,
symbol: symbol,
attributes: attributes
});
}
Attached screenshot. right side is working in 4.5, left side is not working in 4.11.
Thanks,
Benjamin