Image not showing on Hover but on click popup working, what I need to show both actions The...

Can a flute soloist sit?

Can I visit the Trinity College (Cambridge) library and see some of their rare books

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Button changing its text & action. Good or terrible?

Do working physicists consider Newtonian mechanics to be "falsified"?

How to support a colleague who finds meetings extremely tiring?

How to determine omitted units in a publication

What force causes entropy to increase?

Fixing different display colors within string

Is an up-to-date browser secure on an out-of-date OS?

What is the padding with red substance inside of steak packaging?

How many Rusted Keys do you need to get red items most of the time?

Simulating Exploding Dice

Why not take a picture of a closer black hole?

Nested ellipses in tikzpicture: Chomsky hierarchy

What to do when moving next to a bird sanctuary with a loosely-domesticated cat?

60's-70's movie: home appliances revolting against the owners

number sequence puzzle deep six

"is" operation returns false even though two objects have same id

What's the point in a preamp?

how can a perfect fourth interval be considered either consonant or dissonant?

Why doesn't a hydraulic lever violate conservation of energy?

Didn't get enough time to take a Coding Test - what to do now?

Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time?



Image not showing on Hover but on click popup working, what I need to show both actions



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to open popup on mouseover in Leaflet?label for circle marker in leafletLeaflet - Change style on clickSubmit a form from within a leaflet popup?Leaflet/GeoJSON - Changing the default blue marker to other .png filesHow to make both hover and click popup work?Leaflet.draw: add attributes and save to fileChange style of GeoJSON circle marker by feature propertiesLeaflet Sidebar - How to get data based on the GeoJSON you clicked?How to label geojson points in Leaflet?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







-1















What I want to make is to show an image through mouse hover on marker or polygon, and on click show a popup Property attributes information from GEOjson.
I can manage to show attributes by click but not able to show image on hover.
However image can view in console.log but on screen not appearing.
Below is what I want to make please help me.



enter image description here










share|improve this question

























  • I want to show an Image in mouse hover on each marker, polygon, and polyline. I find solution for popup window with more information.

    – Kuntal Parbat
    Sep 22 '16 at 11:27


















-1















What I want to make is to show an image through mouse hover on marker or polygon, and on click show a popup Property attributes information from GEOjson.
I can manage to show attributes by click but not able to show image on hover.
However image can view in console.log but on screen not appearing.
Below is what I want to make please help me.



enter image description here










share|improve this question

























  • I want to show an Image in mouse hover on each marker, polygon, and polyline. I find solution for popup window with more information.

    – Kuntal Parbat
    Sep 22 '16 at 11:27














-1












-1








-1








What I want to make is to show an image through mouse hover on marker or polygon, and on click show a popup Property attributes information from GEOjson.
I can manage to show attributes by click but not able to show image on hover.
However image can view in console.log but on screen not appearing.
Below is what I want to make please help me.



enter image description here










share|improve this question
















What I want to make is to show an image through mouse hover on marker or polygon, and on click show a popup Property attributes information from GEOjson.
I can manage to show attributes by click but not able to show image on hover.
However image can view in console.log but on screen not appearing.
Below is what I want to make please help me.



enter image description here







leaflet geojson leaflet-draw






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 22 '16 at 12:09







Kuntal Parbat

















asked Sep 10 '16 at 7:00









Kuntal ParbatKuntal Parbat

84




84













  • I want to show an Image in mouse hover on each marker, polygon, and polyline. I find solution for popup window with more information.

    – Kuntal Parbat
    Sep 22 '16 at 11:27



















  • I want to show an Image in mouse hover on each marker, polygon, and polyline. I find solution for popup window with more information.

    – Kuntal Parbat
    Sep 22 '16 at 11:27

















I want to show an Image in mouse hover on each marker, polygon, and polyline. I find solution for popup window with more information.

– Kuntal Parbat
Sep 22 '16 at 11:27





I want to show an Image in mouse hover on each marker, polygon, and polyline. I find solution for popup window with more information.

– Kuntal Parbat
Sep 22 '16 at 11:27










1 Answer
1






active

oldest

votes


















0














I found a solution. Hope this will help someone who is searching for a similar question.



The code is:



    popupContent = document.createElement("img");
popupContent.onload = function () {
layer.openPopup();
};
popupContent.src = "path/to/image";
layer.bindPopup(popupContent, {
maxWidth: "auto"

});


Copied content from http://jsfiddle.net/3v7hd2vx/32/



var map = L.map("map");
L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(map);

map.setView([48.85, 2.35], 12);

var marker, popupContent;

for (var i = 0; i < 1; i += 1) {
marker = L.marker([48.85, 2.35]).addTo(map);
popupContent = document.createElement("img");
popupContent.onload = function () {
marker.openPopup();
};
popupContent.src = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Stack_Exchange_logo_and_wordmark.svg/375px-Stack_Exchange_logo_and_wordmark.svg.png";
//popupContent = '<img src="http://c4.staticflickr.com/1/691/21131215939_49601d06ef_b.jpg" />';
marker.bindPopup(popupContent, {
maxWidth: "auto"
});
}

marker.openPopup();


For reference : https://stackoverflow.com/questions/38170366/leaflet-adjust-popup-to-picture-size






share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "79"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f210205%2fimage-not-showing-on-hover-but-on-click-popup-working-what-i-need-to-show-both%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I found a solution. Hope this will help someone who is searching for a similar question.



    The code is:



        popupContent = document.createElement("img");
    popupContent.onload = function () {
    layer.openPopup();
    };
    popupContent.src = "path/to/image";
    layer.bindPopup(popupContent, {
    maxWidth: "auto"

    });


    Copied content from http://jsfiddle.net/3v7hd2vx/32/



    var map = L.map("map");
    L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(map);

    map.setView([48.85, 2.35], 12);

    var marker, popupContent;

    for (var i = 0; i < 1; i += 1) {
    marker = L.marker([48.85, 2.35]).addTo(map);
    popupContent = document.createElement("img");
    popupContent.onload = function () {
    marker.openPopup();
    };
    popupContent.src = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Stack_Exchange_logo_and_wordmark.svg/375px-Stack_Exchange_logo_and_wordmark.svg.png";
    //popupContent = '<img src="http://c4.staticflickr.com/1/691/21131215939_49601d06ef_b.jpg" />';
    marker.bindPopup(popupContent, {
    maxWidth: "auto"
    });
    }

    marker.openPopup();


    For reference : https://stackoverflow.com/questions/38170366/leaflet-adjust-popup-to-picture-size






    share|improve this answer






























      0














      I found a solution. Hope this will help someone who is searching for a similar question.



      The code is:



          popupContent = document.createElement("img");
      popupContent.onload = function () {
      layer.openPopup();
      };
      popupContent.src = "path/to/image";
      layer.bindPopup(popupContent, {
      maxWidth: "auto"

      });


      Copied content from http://jsfiddle.net/3v7hd2vx/32/



      var map = L.map("map");
      L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(map);

      map.setView([48.85, 2.35], 12);

      var marker, popupContent;

      for (var i = 0; i < 1; i += 1) {
      marker = L.marker([48.85, 2.35]).addTo(map);
      popupContent = document.createElement("img");
      popupContent.onload = function () {
      marker.openPopup();
      };
      popupContent.src = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Stack_Exchange_logo_and_wordmark.svg/375px-Stack_Exchange_logo_and_wordmark.svg.png";
      //popupContent = '<img src="http://c4.staticflickr.com/1/691/21131215939_49601d06ef_b.jpg" />';
      marker.bindPopup(popupContent, {
      maxWidth: "auto"
      });
      }

      marker.openPopup();


      For reference : https://stackoverflow.com/questions/38170366/leaflet-adjust-popup-to-picture-size






      share|improve this answer




























        0












        0








        0







        I found a solution. Hope this will help someone who is searching for a similar question.



        The code is:



            popupContent = document.createElement("img");
        popupContent.onload = function () {
        layer.openPopup();
        };
        popupContent.src = "path/to/image";
        layer.bindPopup(popupContent, {
        maxWidth: "auto"

        });


        Copied content from http://jsfiddle.net/3v7hd2vx/32/



        var map = L.map("map");
        L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(map);

        map.setView([48.85, 2.35], 12);

        var marker, popupContent;

        for (var i = 0; i < 1; i += 1) {
        marker = L.marker([48.85, 2.35]).addTo(map);
        popupContent = document.createElement("img");
        popupContent.onload = function () {
        marker.openPopup();
        };
        popupContent.src = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Stack_Exchange_logo_and_wordmark.svg/375px-Stack_Exchange_logo_and_wordmark.svg.png";
        //popupContent = '<img src="http://c4.staticflickr.com/1/691/21131215939_49601d06ef_b.jpg" />';
        marker.bindPopup(popupContent, {
        maxWidth: "auto"
        });
        }

        marker.openPopup();


        For reference : https://stackoverflow.com/questions/38170366/leaflet-adjust-popup-to-picture-size






        share|improve this answer















        I found a solution. Hope this will help someone who is searching for a similar question.



        The code is:



            popupContent = document.createElement("img");
        popupContent.onload = function () {
        layer.openPopup();
        };
        popupContent.src = "path/to/image";
        layer.bindPopup(popupContent, {
        maxWidth: "auto"

        });


        Copied content from http://jsfiddle.net/3v7hd2vx/32/



        var map = L.map("map");
        L.tileLayer("http://{s}.tile.osm.org/{z}/{x}/{y}.png").addTo(map);

        map.setView([48.85, 2.35], 12);

        var marker, popupContent;

        for (var i = 0; i < 1; i += 1) {
        marker = L.marker([48.85, 2.35]).addTo(map);
        popupContent = document.createElement("img");
        popupContent.onload = function () {
        marker.openPopup();
        };
        popupContent.src = "https://upload.wikimedia.org/wikipedia/commons/thumb/7/75/Stack_Exchange_logo_and_wordmark.svg/375px-Stack_Exchange_logo_and_wordmark.svg.png";
        //popupContent = '<img src="http://c4.staticflickr.com/1/691/21131215939_49601d06ef_b.jpg" />';
        marker.bindPopup(popupContent, {
        maxWidth: "auto"
        });
        }

        marker.openPopup();


        For reference : https://stackoverflow.com/questions/38170366/leaflet-adjust-popup-to-picture-size







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 mins ago









        MrXsquared

        2,0111720




        2,0111720










        answered Sep 27 '16 at 5:06









        Kuntal ParbatKuntal Parbat

        84




        84






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f210205%2fimage-not-showing-on-hover-but-on-click-popup-working-what-i-need-to-show-both%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Щит и меч (фильм) Содержание Названия серий | Сюжет |...

            Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

            Meter-Bus Содержание Параметры шины | Стандартизация |...