1

I am using the plugin Leaflet DVF (https://github.com/humangeo/leaflet-dvf). It uses this code to bind a popup to a polygon and create a table inside it displaying its corresponding records (a row for each record) coming from a JS file.

This is the code for the popup:

                onEachRecord: function (layer,record) {
        var $html = $(L.HTMLUtils.buildTable(record));

        layer.bindPopup($html.wrap('<div/>').parent().html(),{
            minWidth: 600,
            maxWidth: 700
        });
    },

This is the file with the record information:

var NLpopdens =[
{
    "CODIGO": "01",
    "NAME": "10",
    "POPU": "635100",
    "AREA": "162.18",
    "Density": "Title<br/><img src='http://joshuafrazier.info/images/maptime.gif' alt='maptime logo gif' width='350px'/>"
},
{
    "CODIGO": "02",
    "NAME": "11",
    "POPU": "263500",
    "AREA": "227.11",
    "Density": "Title<br/><div id='container' style='width:200px; height:300px;'></div>"
},

I am able to run the popup with an image but not with a DIV inside it. Does anyone know how to solve this?

PS. The Console in the browser gives me the following error:

Uncaught Error: Highcharts error #13: www.highcharts.com/errors/13 at Object.a.error (highcharts.js:10) at a.Chart.getContainer (highcharts.js:258) at a.Chart.firstRender (highcharts.js:273) at a.Chart.init (highcharts.js:249) at a.Chart.getArgs (highcharts.js:248) at new a.Chart (highcharts.js:247) at Object.a.chart (highcharts.js:247) at HTMLDocument. (conflictdata.html:679) at c (jquery-1.9.1.min.js:3) at Object.fireWith [as resolveWith] (jquery-1.9.1.min.js:3)

And the Highcharts code:

Highcharts.chart('container', {
chart: {
    renderTo: 'container',
    type: 'area'
},
title: {
    text: 'Area chart with negative values'
},
xAxis: {
    categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
credits: {
    enabled: false
},
series: [{
    name: 'John',
    data: [5, 3, 4, 7, 2]
}, {
    name: 'Jane',
    data: [2, -2, -3, 2, 1]
}, {
    name: 'Joe',
    data: [3, 4, 4, -2, 5]
}]

});

1 Answer 1

-1

Manuel, see my answer here: https://github.com/humangeo/leaflet-dvf/issues/117. Let me know if this helps.

1
  • Welcome to GIS SE! As a new user please take the tour to learn about our focused Q&A format. Here you have answered a question using just a link to another site. Links can change or disappear without warning, so please edit your answer here to include your proposed solution, using your link as a reference rather than an answer. Link-only questions may be deleted.
    – Midavalo
    Aug 31, 2017 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.