Skip to content

TypeError: undefined is not an object (evaluating 'e.width') #35

@nikischin

Description

@nikischin

I am trying to implement this plugin into my application. First of all thank you so much for providing this library, this is great!

However, while playing around I ran into the following issue:

image image
export default function LocationOverviewMap () {
    const locations = [ {
        id: 1,
        lat: 48,
        lon: 9,
        title: 'Test 1 48 9',
    },
    {
        id: 2,
        lat: 49,
        lon: 9,
        title: 'Test 2 49 9',
    },
    {
        id: 3,
        lat: 48,
        lon: 10,
        title: 'Test 3 48 10',
    } ];

    const [ selectedLocation, setSelectedLocation ] = useState();

    return (
        <><div className='window-split-main'>
            <Header />
            <div style={{ height: 'calc(100vh - 60px)' }}>
                <Map
                    token="my token ..."
                    isRotationEnabled={false}
                    isZoomEnabled={true}
                    showsCompass={0}
                    showsMapTypeControl={true}
                    showsUserLocation={true}
                    showsUserLocationControl={true}
                    showsPointsOfInterest={false}
                    mapType={0}
                >
                    {locations.map(location=> (<React.Fragment key={location.id}>
                        <Marker
                            latitude={location.lat}
                            longitude={location.lon}
                            color='#333'
                            glyphImage={{ 1: 'https://externalimageurl.com' }}
                            onSelect={()=> setSelectedLocation(location.id)}
                        />
                        <Annotation
                            latitude={location.lat}
                            longitude={location.lon}
                            title={location.title}
                            selected={selectedLocation === location.id}
                        />
                    </React.Fragment>))}
                </Map>
            </div>
        </div></>
    );
}

The error happens whenever I click on one of the markers and an Annotation is visible. Not sure if I am doing the implementation wrong or what is the issue here.

Also when playing around with the Storybook I often after some time get an error like this, not sure if this is similar to the first error in my error log and has something to do with this error:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions