Fix: Add userAgentPackageName to TileLayer for flutter_map v6.2.1 tile rendering
Maps were not rendering in flutter_map v6.2.1 because TileLayer was missing the required userAgentPackageName property. This property is needed for proper HTTP requests to tile servers with correct User-Agent headers. - Updated TileLayer in genericMap.dart with userAgentPackageName - Updated TileLayer in monitoredAreas.dart with userAgentPackageName - Fixes: Maps not displaying tiles after flutter_map v6 migration
This commit is contained in:
parent
fa8c388f07
commit
2486465e44
2 changed files with 4 additions and 1 deletions
|
|
@ -214,6 +214,7 @@ class _genericMapState extends State<genericMap> {
|
|||
maxZoom: maxZoom,
|
||||
urlTemplate: baseLayer,
|
||||
subdomains: subdomains,
|
||||
userAgentPackageName: 'com.example.fires_flutter',
|
||||
additionalOptions: {
|
||||
// 'opacity': '0.1',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -81,7 +81,9 @@ class MonitoredAreasPage extends StatelessWidget {
|
|||
new TileLayer(
|
||||
urlTemplate:
|
||||
"https://tiles.wmflabs.org/bw-mapnik/{z}/{x}/{y}.png",
|
||||
subdomains: ['a', 'b', 'c']),
|
||||
subdomains: ['a', 'b', 'c'],
|
||||
userAgentPackageName:
|
||||
'com.example.fires_flutter'),
|
||||
new PolylineLayer(
|
||||
polylines: view.monitoredAreas,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue