flutter_map marker

 class _MapDataState extends State<MapData> {
      List<SitesList> sl = [];
      List<SnoTelSite> sts = [];
      var marker = <Marker>[];

      _MapDataState(){
        print("map data state");
        loadSites().then((sitesdata) {
          print('Loaded Sites Asset JSON');
          //clone sitesdata into sts array
          sts..addAll(sitesdata);
          sts.forEach((s) {
            marker.add(
              Marker(
                point: new LatLng(double.parse(s.lat),double.parse(s.lng)),
                builder: (ctx) => _MarkerPopUp(sitename: s.name, siteelevation: s.elevation, siteid: s.siteID,),
              ),
            );
          });
        });
      }

      // @override
      // initState() {
      //   print("INIT STATE");
      //   super.initState();
      // }

      //local load assets ... constants hold path snotelsitesjson
      Future<String> _loadSiteAssets() async {
        return await rootBundle.loadString(snotelsitesjson);
      }

      Future loadSites() async {
        String jsonString = await _loadSiteAssets();
        final jsonResponse = json.decode(jsonString);
        SitesList sitesList = new SitesList.fromJson(jsonResponse);
        return sitesList.sites;
      }

    //main build and screen layout
      @override
      Widget build(BuildContext context) {
        print("BUILD LAYOUT");
        return MaterialApp(
          theme: ThemeData(
            primarySwatch: Colors.cyan,
          ),
          home: Scaffold(
              appBar: AppBar(
                backgroundColor: Colors.white,
                leading: Icon(Icons.ac_unit),
                title: Text("SnoTel Map"),
                actions: <Widget>[
                  IconButton(
                    icon: Icon(Icons.favorite),
                    onPressed: () {
                      debugPrint("Favorites");
                    },
                  ),
                  IconButton(
                    icon: Icon(Icons.feedback),
                    onPressed: () {
                      debugPrint("Message sent");
                    },
                  ),
                ],
              ),
              body: _MapWidget()),
        );
      }
    }

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
marker in google map flutter Flutter Custom marker google maps flutter map add marker add marker method to google map in flutter flutter map cluster marker how to add a marker to google maps flutter flutter add marker to map flutter custom map marker custom google maps marker flutter flutter google maps widget marker flutter_map marker cluster how to add a marker on google map flutter flutter how to set marker in google map flutter_map add marker to map flutter map add marker to map flutter_map add markers to map flutter google map marker with name show info on marker map flutter flutter google maps show marker of result flutter map routet marker show marker on Google maps flutter flutter markers maps GoogleMap marker flutter marker for google_maps_flutter how to add marker in flutter set marker in google map flutter flutter add marker google map flutter add marker flutter map with marker marker id google maps flutter make a custom marker on maps flutter flutter map set marker flutter set marker on map flutter google map marker design flutter map app marker flutter google maps marker tag list of map markers flutter display marker on google map flutter marker builder flutter map flutter import for Google maps marker add marker to google maps flutter adding marker for google maps flutter adding marker on map created for flutter google map marker flutter marker map flutter flutter google map add marker flutter googlemap add marker flutter google maps marker example add marker on maps in flutter flutter marker google maps google map custom marker flutter custom marker google maps flutter google map add marker flutter rxdart google map marker flutter add marker in mapbox flutter google maps flutter add marker add marker to google map flutter how to put markers on a map flutter how to set marker in google map flutter flutter maps add markers flutter google maps add marker &quot;flutter_map&quot; marker tap flutter map marker tap flutter map marker flutter map marker ontap Flutter Google Maps Go To Marker flutter maps and markers flutter google map marker google map flutter marker how to put marker in google maps flutter how to add markers in flutter in map flutter google maps marker how to make marker in google map in fluttter google maps marker flutter google maps with marker flutter how to add marker in google map flutter markers flutter_map marker flutter google maps display markers flutter_map display marker flutter_map flutter_map list of markers flutter_map list of marker
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source