Pakete und Repositories suchen

GitHub-RepositoryAyushBherwani1998/here_maps_webservice

here_maps_webservice

Here Maps Paket für Flutter

Projektcover von here_maps_webservice
Sterne
12
Forks
6
Letzter Push (UTC)
13.06.2020
Projektstatus
Aktiv

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.

Here

here_maps_webservice

pub package

About

here_maps_webservice provides Here Maps Web Services API wrapper that serve different purposes from search, to geocoding.

Usage

Add here_maps_webserviceas a dependency in your pubspec.yaml

 dependencies:
  flutter:
    sdk: flutter
  here_maps_webservice: 1.0.2

Run flutter pub get in the terminal and import import 'package:here_maps_webservice/here_maps.dart'

Availabel APIs

Generate API KEY

Go to https://developer.here.com/ and create a new account if you don't have one. Create a new project and select Freemium Plan. Under the REST section of your project, click on Create API key.

Example

Nearby Places
    import 'package:here_maps_webservice/here_maps.dart';
    import 'package:location/location.dart' as l; 
    import 'package:flutter/services.dart';
    
    var currentLocation;
    var location = new l.Location();
    List<dynamic> _nearbyPlaces=[]; 

    try {
      currentLocation = await location.getLocation();
      }on PlatformException catch (error) {
      if (error.code == 'PERMISSION_DENIED') {
        print("Permission Dennied");
      }
    }
    
    HereMaps(apiKey: "your apiKey")
          .exploreNearbyPlaces( lat: currentLocation.latitude, lon: currentLocation.longitude,offset: 10)
          .then((response) {
              setState(() {
                  _nearbyPlaces.addAll(response['results']['items']);
              });
          });

Popular Places
    import 'package:here_maps_webservice/here_maps.dart';
    import 'package:location/location.dart' as l; 
    import 'package:flutter/services.dart';
    
    var currentLocation;
    var location = new l.Location();
    List<dynamic> _explorePopularPlace = []; 

    try {
      currentLocation = await location.getLocation();
      }on PlatformException catch (error) {
      if (error.code == 'PERMISSION_DENIED') {
        print("Permission Dennied");
      }
    }
    
    HereMaps(apiKey: "your apiKey")
          .explorePopularPlaces(
              lat: currentLocation.latitude,
              lon: currentLocation.longitude,
              offset: 10)
          .then((response) {
        setState(() {
          _explorePopularPlace.addAll(response['results']['items']);
        });
      });

Geocoding Autocomplete
     import 'package:here_maps_webservice/here_maps.dart';
     
     List<dynamic> _suggestion = [];
     
     HereMaps(apiKey: "your apiKey")
           .geoCodingAutoComplete(query: "YourQuery")
           .then((response) {
         setState(() {
           _suggestion.addAll(response['suggestions']);
         });
       });
Geocoding
    import 'package:here_maps_webservice/here_maps.dart';
    
    Map<String, dynamic> latLon = Map();
    
    HereMaps(apiKey: "your apiKey")
        .geoCode(searchText: _searchController.text)
        .then((response) {
      setState(() {
        latLon = response['Response']['View'][0]['Result'][0]['Location']
            ['DisplayPosition'];
      });
    });
Reverse Geocoding
    import 'package:here_maps_webservice/here_maps.dart';
    import 'package:location/location.dart' as l; 
    import 'package:flutter/services.dart';
    
    var currentLocation;
    var location = new l.Location();

    try {
      currentLocation = await location.getLocation();
      }on PlatformException catch (error) {
      if (error.code == 'PERMISSION_DENIED') {
        print("Permission Dennied");
      }
    }
    
    Map<String,dynamic> response = HereMaps(apiKey: "your apiKey")
      .reverseGeoCode(lat: currentLocation.latitude, lon: currentLocation.longitude)

TODO

  • Add all the parameters in the existing APIs
  • Add tests
  • Make Model class for exisitng APIs
  • Add routing APIs

Feature Requests and Issues

Please file feature requests and bugs at the issue tracker

Contributing

We would love to see you contribute to here_maps_webservice. Do check out our Contributing Guidelines.

Ayush Bherwani GitHub avatar
GitHub-Autor

Ayush Bherwani ↗

DevRel Engineer @MetaMask 🚀

Web3AuthOn Chain
SprachenDartSwiftKotlinObjective-C

Kategorien

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 3 Einträge

  • flutter{"sdk":"flutter"}
  • http^0.12.0+4
  • flutter_testEntwicklung{"sdk":"flutter"}

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.

Quellen und Pflege

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗