The code to create the map:
<div id="map" style="width: 1000px; height: 700px"></div>
<script>
var map = L.map('map').setView([0,0], 1);
L.tileLayer('https://api.mapbox.com/styles/v1/mapbox/streets-v10/tiles/{z}/{x}/{y}?access_token=pk.ey31IjoibnVtaW51czEiLCJhIjoiY2treTN3YzduekdwMDJubXNhMWNpemdicyJ9.McJEAeE0Jbj999Oz4pbsZg', {
attribution: '<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>'
}).addTo(map);
var marker = L.marker([18.52, 73.86]).addTo(map);
This is correctly creating a map. Now, I'm trying to add a geopackage containing data about states: https://biogeo.ucdavis.edu/data/gadm3.6/gpkg/gadm36_IND_gpkg.zip
When I use the tutorial code to draw rivers onto the map, it works just fine:
var rivers = L.geoPackageFeatureLayer([], {
geoPackageUrl: 'http://ngageoint.github.io/GeoPackage/examples/rivers.gpkg',
layerName: 'rivers',
style: {color: 'green'}
}).addTo(map);
L.geoJson(stateData).addTo(map);
And, when I upload this state geopackage to the geopackage viewer https://ngageoint.github.io/geopackage-js/, it draws everything correctly. However, when I then try to implement the same thing in my map, the map renders fine but the state lines aren't being drawn on the map; there is simply no indication that the following code is even there:
var stater = L.geoPackageFeatureLayer([], {
geoPackageUrl: 'assets/geospatial/gadm_states.gpkg',
layerName: 'stater',
style: {color: 'red'}
}).addTo(map);
I thought maybe it was because there are multiple layers in the gpkg file and I wasn't correctly specifying on or something, so I downloaded the layer I wanted from the GeoPackage Viewer as a geojson file, and that isn't working either. Does anyone have any insight as to what is going wrong?