-
Can you read the shapefile correctly using
st_read? Are you uploading all four shapefile components (ie the .shp, .shx, .dbf and .prj files)? I just tested this snippet and it still works for me.Edited by Barry Rowlingson -
I can read the shapefile :
*Listening on http://127.0.0.1:7786 Upload dir is/tmp/RtmptMVO68/984dcb00eb9da2996c5a8eac Reading layer `mmr_polbnda_adm0_250k_mimu' from data source `/tmp/RtmptMVO68/984dcb00eb9da2996c5a8eac/mmr_polbnda_adm0_250k_mimu.shp' using driver `ESRI Shapefile' Simple feature collection with 1 feature and 6 fields geometry type: MULTIPOLYGON dimension: XY bbox: xmin: 92.17275 ymin: 9.671252 xmax: 101.1699 ymax: 28.54554 epsg (SRID): 4326 proj4string: +proj=longlat +datum=WGS84 +no_defs Warning: Error in xy.coords: 'x' and 'y' lengths differ*I'm uploading just the four shapefile components yes. What I changed from your code is the position of the "plot(st_geometry(inShp()))".
It's now here :
leaflet() %>% addProviderTiles("Esri.WorldImagery", group = "Esri World Imagery", options = providerTileOptions(minZoom = 2, maxZoom = 17)) %>% addTiles(group = "OSM", options = providerTileOptions(minZoom = 2, maxZoom = 17)) %>% setView(lng = 96.221,lat = 20.792, zoom = 6 ) %>% ** plot(st_geometry(inShp()))** addLayersControl(baseGroups = c("Esri World Imagery", "OSM")) })Is that the problem ?
Edited by Victor Réchou
Please register or sign in to comment