Click here to Skip to main content
15,742,477 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi there - I am using Javascripts on Highmaps and am getting the error: Uncaught SyntaxError: Unexpected token va on the following code. Can someone please point out where I am going wrong?

$(function () {


  $.getJSON('http://127.0.0.1:8887/Census2011_ReprojectedWithJoin_v2.geojson', function (geojson)
  // Prepare random data
    var data = [geojson.features.'2011 Population'] {

        // Initiate the chart
        Highcharts.mapChart('container', {
debugger;
            title: {
                text: 'GeoJSON in Highmaps'
            },

            mapNavigation: {
                enabled: true,
                buttonOptions: {
                    verticalAlign: 'bottom'
                }
            },

            colorAxis: {
            },
debugger;
            series: [{
                data: data,
                mapData: geojson,
                name: 'Random data',
                states: {
                    hover: {
                        color: '#BADA55'
                    }
                },
                dataLabels: {
                    enabled: true,
                    format: '{point.properties.postal}'
                }
            }]
        });
    });
 });


What I have tried:

debugging, counting the number of brackets - I cannot see what is wrong
Posted
Updated 13-Nov-16 7:00am
v2

1 solution

Here:
var data = [geojson.features.'2011 Population'] {

Next time you copy a sample do it properly, and use a decent JavaScript editor...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900