bjornd / jvectormap

jvectormap.com
GNU Affero General Public License v3.0
1.38k stars 431 forks source link

On hover of a custom image point on google chrome - image is loaded again and again #469

Open theurere2 opened 3 years ago

theurere2 commented 3 years ago

When using a custom image for a point on the map in google chrome the image is loaded again and again on image hover. Using google chrome version 89.0.4389.114. My map settings are:

    jquery("#" + MAP_ID).vectorMap({
        backgroundColor: "white",
        regionStyle: {
            initial: {
                fill: "#ecf0f1",
                stroke: "#9aaaab",
                "stroke-width": 1,
            },
            hover: {
                fill: "#959595",
                "fill-opacity": 1,
            },
        },
        markerStyle: {
            initial: {
                fill: "#319b42",
                image: "/typo3conf/ext/example/Resources/Public/Images/map-marker.png",
            },
        },
        map: map,
        markersSelectable: true,
        markersSelectableOne: true,
        markers: markers,
        onMarkerClick: function (evt: object, code: string) {
            //console.log('evt', evt, 'code', code);
            let markerId = "#map-marker-" + continent + "-" + code;
            jquery(markerId).siblings().removeClass("open");
            jquery(markerId).addClass("open");
            jquery(markerId + " .icon-x").click(function () {
                jquery(markerId).removeClass("open");
            });
        },
        zoomOnScroll: false
    });

See attached screenshot.

Screen Shot 2021-04-09 at 14 26 57