Use topoJSON on Map Flyers

I am learning how to use the Flyer to create interactive interactive maps for public health purposes (experienced ArcGIS user, Mapbox TileMill). I take it slowly, so I understand every piece of code, and I work from the Chopopleth Leaflet example , how I want to make choropleth maps. The current task I'm stuck with is correctly adding the topoJSON data to the sheet map. I tried using the following code to convert geoJSON states to topoJSON, but it did not work. Any suggestions?

    var geojson;

    var test = topojson.feature(us-states-topo, us-states-topo.objects.layer1 );

    geojson = L.geoJson(test, {
        style: style,
        onEachFeature: onEachFeature
    }).addTo(map);

I reviewed the topoJSON reference API , but I'm sure I should make a simple mistake as I start to JavaScript in general. Thank you all for your help!

Best eli

+3
1

, .

var test = topojson.feature(us-states-topo, us-states-topo.objects.layer1 );

JavaScript: us-states-topo , - .

+5

All Articles