Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

mapbox search and static image pure dart implementation

a flutter package for place search using mapbox api and for static map image
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,
      onselected: (place) {},
      context: context,
)

screenshots

mapbox search

search2

search1


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.