Code Monkey home page Code Monkey logo

arcgis-maps-sdk-flutter-samples's Introduction

ArcGIS Maps SDK for Flutter Samples

This repository contains Flutter sample code demonstrating the capabilities of ArcGIS Maps SDK for Flutter and how to use them in your own app. This SDK enables development of cross-platform GIS apps for mobile devices running iOS and Android.

Run the samples using the Beta package of ArcGIS Maps SDK for Flutter

Visit earlyadopter.esri.com and download the ArcGIS Maps SDK for Flutter package. Follow the instructions to unpack it.

Clone or download this repository into the same parent directory as the arcgis_maps_package. Your file structure should be:

parent_directory
   |
   |__ arcgis-maps-sdk-flutter-samples
   |
   |__ arcgis_maps_package

Navigate to the arcgis-maps-sdk-flutter-samples directory.

cd arcgis-maps-sdk-flutter-samples

Use flutter pub upgrade to configure the dependencies.

flutter pub upgrade

Install arcgis_maps_core.

dart run arcgis_maps install

Now you are ready to run the samples app!

Running the Samples app

The app can be run on an iOS or Android simulator or device. Note: you will need to configure an API key to take full advantage of the samples in the app. See Configuring API Keys.

  • Open the flutter project in VSCode
  • Ensure a simulator is running or a device is connected to your development machine
  • Open the "Run and Debug" sidebar
  • Select which device or simulator you wish to use in the lower right corner of the VSCode window
  • Select "Samples (debug or release)"
    • Note that "Samples (release)" can only be run on a device
  • Click the run button or press F5

Running individual samples

Individual samples can also be run on an iOS or Android simulator or device.

  • Open the flutter project in VSCode
  • Ensure a simulator is running or a device is connected to your development machine
  • Select which device or simulator you wish to use in the lower right corner of the VSCode window
  • To run from VSCode, open a sample file from /lib/src/samples e.g. display_map.dart and click run above the main() method
  • Or run from the command line with flutter run lib/src/samples/display_map.dart

Configuring API Keys

To take full advantage of the samples in the app, you will need to generate an API Key.

  • Log into your developer account at ArcGIS Developers
  • Go to the "API keys" tab
  • Click the "New API Key" button and provide a Title and Description
  • Set Location Service scopes to add or remove key capabilities

Add the new API Key directly to main.dart or create an environment JSON file that can be loaded with the --dart-define-from-file flutter run command line argument.

The JSON file itself should be of the format:

{
    "API_KEY": "your_api_key_here"
}

To run using the JSON file to define your API key:

flutter run --dart-define-from-file=path/to/json/file.json

Or to run an individual sample:

flutter run lib/src/samples/display_map.dart --dart-define-from-file=path/to/json/file.json

Licensing

Copyright 2024 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's LICENSE file.

arcgis-maps-sdk-flutter-samples's People

Contributors

jenmerritt avatar paulallansturm avatar ldanzinger avatar kmueller-gis 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.