Skip to content

Change img.src and map on the fly -> Error Unable to set property 'coords' #66

@SarahTrees

Description

@SarahTrees

Error: Unable to set property 'coords' of undefined or null reference

Everything works the way we want it first time, excellent, thank you for the tool!

Our users can change the src of the image. After that we delete all area from the map and put new area in the map.

There are problems here. The tool saves the old areas between and wants to adjust them after the src change. But at this time the map has no area.

Error: Unable to set property 'coords' of undefined or null reference
Line 20: areas[idx].coords = cachedAreaCoords.split(',').map(scale).join(',');
Reason: areas[idx] is undefined.

How can we change the src and build the new map without having this error?

The tool was initialized by $ ('#mainpicture map').ImageMapResize();
How can we de-initialize / destroy / delete / remove it? To reinitialize it after setting all the HTML details?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions