Select to view content in your preferred language

Street name covers graphic icon

319
1
05-14-2024 06:03 AM
AndrewAE
New Contributor

I'm using FeatureLayer to render graphics but the icons appear under the street names

AndrewAE_0-1715691666541.png

I tried to sort the layers, but the reorder function doesn't work for me

layers.reorder(eventLayer, 1)


This is how I create graphics

export const createGraphic = ({
    mapViewporItem,
    objectId,
    selectedEventId,
    selectedMapLedgerEntityType,
}: CreateGraphicParams): Graphic | undefined => {
    const itemLocation = getEventLocation(mapViewporItem);
    const uiState = getUiState({
        ...
    });
    const iconType = getEventIconType(mapViewporItem);
    const itemGraphicAttributes: MapViewportItemGraphicAttributes = {
        objectId,
        entityId: mapViewporItem.entityId,
        iconName: `${iconType}, ${uiState}`,
        uiState,
        priority: mapViewporItem.priority,
        agencyTypeGlobalAttrId: mapViewporItem.agencyTypeGlobalAttrId,
    };
    const graphicProperties = {
        attributes: itemGraphicAttributes,
        geometry: {
            type: 'point',
            y: itemLocation.latitude,
            x: itemLocation.longitude,
            spatialReference: ESRI_SPATIAL_REFERENCE,
        },
    };
    return new Graphic(graphicProperties);
};

 

 

0 Kudos
1 Reply
JianglinWu
Emerging Contributor

use the example from arcgis

https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=webstylesymbol-2d
basemap: "gray-vector"  street names are on top of graphics/icons,

basemap: "topo-vector" icons are on top of street names.

is there way to make icons alway on top, on any basemaps?

 

 

 

 

0 Kudos