/ionic-angular-tutorial

:clipboard: App to show a map view of a location using Leaflet & the Ionic framework.

Primary LanguageTypeScriptMIT LicenseMIT

⚡ Ionic Angular Tutorial

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • Leaflet has lots of options for map control & user interaction
  • Leaflet Marker used to display clickable/draggable icons on the map
  • Leaflet Bouncemaker v1 used to add bounce animation to the marker
  • Angular no longer comes with linting by default so ESLint was added.

📷 Screenshots

Ionic page Ionic page

📶 Technologies

💾 Setup

  • Run npm i to install dependencies
  • To start the server on localhost://8100 type: 'ionic serve'
  • ng lint to lint project - the Ionic boilerplate is old and newer version add component to tab component pages. This causes lint errors error Component class names should end with one of these suffixes: "Component" (https://angular.io/styleguide#style-02-03) @angular-eslint/component-class-suffix. This could be fixed with a lot of filename changes etc.

💻 Code Examples

  • Basic setup to show Big Ben on a map
ngOnInit() {
    this.map = L.map('map', {
      // center on the coordinates for Big Ben
      center: [51.50148, -0.12351],
      zoom: 15,
      renderer: L.canvas()
    })

    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
      attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
    }).addTo(this.map)

    setTimeout(() => {
      this.map.invalidateSize();
    }, 0)

  }

🆒 Features

📋 Status & To-do list

  • Status: Working
  • To-do: Nothing

👏 Inspiration - By Samiullah Khan @Techbuzz

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact