This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new TileLayerOptions( | |
urlTemplate: urlStart + (isPresentTime ? "Your present time style" : "Your overlay style") + urlEnd, | |
additionalOptions: { | |
'accessToken': | |
'Your accessToken', | |
}, | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Full URL: https://api.mapbox.com/styles/v1/{user}/{style}/tiles/256/{z}/{x}/{y}?access_token={accessToken} | |
const urlStart = "https://api.mapbox.com/styles/v1/{user}/"; | |
const urlEnd = "/tiles/256/{z}/{x}/{y}?access_token={accessToken}"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _openPopupMenu() => PopupMenuButton<int>( | |
onSelected: (value) { | |
setState(() { | |
value == 1 ? isPresentTime = true : isPresentTime = false; // shorter form: isPresent = value == 1; | |
}); | |
}, | |
itemBuilder: (context) => [ | |
... | |
], | |
icon: Container( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return SafeArea( | |
child: Scaffold( | |
body: Stack( | |
children: [ | |
FlutterMap( | |
... | |
), | |
Positioned( | |
top: 0, | |
right: 0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget _openPopupMenu() => PopupMenuButton<int>( | |
itemBuilder: (context) => [ | |
PopupMenuItem( | |
value: 1, | |
child: Text("Present time"), | |
), | |
PopupMenuItem( | |
value: 2, | |
child: Text("Budapest 1884"), | |
), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Scaffold( | |
body: FlutterMap( | |
options: MapOptions( | |
onLongPress: addPin, | |
center: LatLng(47.4990, 19.0437), // Széchenyi Chain Bridge Coordinates | |
zoom: 12.0, // Changed zoom level from 16 to 12, to better see the whole overlay area from further distance | |
minZoom: 10, | |
plugins: [ | |
UserLocationPlugin(), | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomePage extends StatefulWidget { | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} | |
class _HomePageState extends State<HomePage> { | |
MapController mapController = MapController(); | |
UserLocationOptions userLocationOptions; | |
List<Marker> markers = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_map/flutter_map.dart'; | |
import 'package:latlong/latlong.dart'; | |
import 'package:user_location/user_location.dart'; | |
class HomePage extends StatefulWidget { | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomePage extends StatefulWidget { | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} | |
class _HomePageState extends State<HomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
body: FlutterMap( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_map/flutter_map.dart'; | |
import 'package:latlong/latlong.dart'; | |
class HomePage extends StatefulWidget { | |
@override | |
_HomePageState createState() => _HomePageState(); | |
} | |
class _HomePageState extends State<HomePage> { |
NewerOlder