Git Product home page Git Product logo

here_maps_webservice's Introduction

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.

here_maps_webservice's People

Contributors

arps18 avatar ayushbherwani1998 avatar pomarec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

here_maps_webservice's Issues

Plugin Update

Hi, I'm running into issues using this plugin as I have to downgrade several other plugins to run without error. Any chance this is getting updated soon. Mainly, I can't use Dio 4.0.0 which I need to solve an issue I'm having on the web. Using Dio 4 requires an additional 2 plugin updates and then it stops with Here_maps_webservice eventually being the failed plugin.

Conflict library

Hello,

Would like to use your library, but since you are using location library for your examples and I need this version : location: 3.2.4
I got the following error:

Because here_maps_webservice >=1.0.3 depends on location ^2.3.5 and v_tracking depends on location 3.2.4, here_maps_webservice >=1.0.3 is forbidden.
So, because v_tracking depends on here_maps_webservice 1.0.3, version solving failed.

Here are used version:
location: 3.2.4
here_maps_webservice: 1.0.3

Could you do anything please?
Thank you!

New feature request

Can you please try to add the map view/load a map scene to this package or release a new package alone for that. It would be very beneficial for newbies like me. Thank you.

Assets maxResults <= 1.

maxResults cant be set at the moment because of assert maxResults <= 1 instead of maxResults >= 1 && maxResults <= 10

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.