GithubHelp home page GithubHelp logo

rodrigolmacedo / mapbox_search Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shinayser/mapbox_search

0.0 1.0 0.0 1.21 MB

A Flutter package for place search using MapBox Api and for Static map image

License: MIT License

Java 1.07% Objective-C 2.21% Dart 95.19% Shell 1.54%

mapbox_search's Introduction

mapbox_search

Pub Awesome Flutter

PR ? You're most welcomed....

MapBox Search and Static Image pure Dart Implementation

A Flutter package for place search using MapBox Api, Reverse Geocoding and for Static map image.

Reverse Geocoding displays the nearby places based on the feeded Location data.

I made this package because google place search was not working that much efficiently(daily quota limit) and MapBox offers plenty of free search requests.

Way more useful than google if you want static map images...

Installing

Add the following to your pubspec.yaml file:

dependencies:
  mapbox_search: any

Example

Static Image

MapBoxStaticImage staticImage = MapBoxStaticImage(
    apiKey:
        "API Key");

Image With Polyline

String getStaticImageWithPolyline() => staticImage.getStaticUrlWithPolyline(
  point1: Location(lat: 37.77343, lng: -122.46589),
  point2: Location(lat: 37.75965, lng: -122.42816),
  marker1: MapBoxMarker( markerColor: Colors.black, markerLetter: 'p', markerSize: MarkerSize.LARGE),
  msrker2: MapBoxMarker(
      markerColor: Colors.redAccent,
      markerLetter: 'q',
      markerSize: MarkerSize.SMALL),
  height: 300,
  width: 600,
  zoomLevel: 16,
  style: MapBoxStyle.Mapbox_Dark,
  path: MapBoxPath(pathColor: Colors.red, pathOpacity: 0.5,     pathWidth: 5),
  render2x: true);

Image with Marker

String getStaticImageWithMarker() => staticImage.getStaticUrlWithMarker(
  center: Location(lat: 37.77343, lng: -122.46589),
  marker: MapBoxMarker(
      markerColor: Colors.black, markerLetter: 'p', markerSize: MarkerSize.LARGE),
  height: 300,
  width: 600,
  zoomLevel: 16,
  style: MapBoxStyle.Mapbox_Streets,
  render2x: true,
);

Image without Marker

String getStaticImageWithoutMarker() => staticImage.getStaticUrlWithoutMarker(
    center: Location(lat: 37.75965, lng: -122.42816),
    height: 300,
    width: 600,
    zoomLevel: 16,
    style: MapBoxStyle.Mapbox_Outdoors,
    render2x: true,
  );

Search Widget

MapBoxPlaceSearchWidget(
      popOnSelect: true,
      apiKey:
          "API KEY",
      limit: 10,
      searchHint: 'Your Hint here',
      onSelected: (place) {},
      context: context,
)

Reverse GeoCoding

var reverseGeoCoding = ReverseGeoCoding(
    apiKey: 'API Key',
    limit: 5,
);

Future<List<MapBoxPlace>> getPlaces() =>
  reverseGeoCoding.getAddress(
    Location(lat: 72.0, lng: 76.00),
);

Places Seach

var placesSearch = PlacesSearch(
    apiKey: 'API Key',
    limit: 5,
);

Future<List<MapBoxPlace>> getPlaces() =>
  placesSearch.getPlaces("New York");

Screenshots

Static Map Image

Static Map Image

Search Widget

Demo

Demo

mapbox_search's People

Contributors

ketanchoyal avatar shinayser avatar dbbd59 avatar

Watchers

James Cloos avatar

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.