O'Reilly logo

Dart: Scalable Application Development by Ivo Balbaert, Sergey Akopkokhyants, Davy Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Application overview

The mapviewer project is a Dart web application with an index.html entry point that kicks off the application on main.dart:

main() async {
  quakeMap = new MapDisplay(querySelector('#mapview'), width, height);
  await quakeMap.loadImage();

  featPlotter = new FeaturePlotter(width, height, quakeMap.mapCtx);

  quakeMap.showPopup = showPopup;
  quakeUpdate();

  querySelector('#zoombtn').onClick.listen(zoomMap);
  querySelector('#locatebtn').onClick.listen(locateUser);
  querySelector('#sortbtn').onClick.listen(sortFeatures);

  new Timer.periodic(new Duration(seconds: 60), quakeUpdate);
  new Timer.periodic(new Duration(milliseconds: 100), animationUpdate);
}

The MapDisplay class sets up the map on the web page (on the div element with the ID mapview ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required