Giter Club home page Giter Club logo

maps-app-dotnet's Introduction

Maps App .NET

The Maps App for .NET shows how a suite of applications can be built around the ArcGIS Platform using the ArcGIS Runtime SDK for .NET and a combination of WPF and the cross-platform framework Xamarin Forms. It demonstrates best practices around some simple but key functionality of the ArcGIS Runtime. You can use the Maps App as is, or extend it to meet your specific needs. Detailed documentation about the app and its architecture can be found on the developers website.


Features

  • Place Search
  • Geocode addresses
  • Reverse Geocode
  • Turn-by-turn Directions
  • Dynamically switch basemaps
  • Open Web Maps
  • Work with ArcGIS Online or an on-premise ArcGIS Portal
  • OAuth2 authentication

Detailed Documentation

Read the docs for a detailed explanation of the application, including its architecture and how it leverages the ArcGIS platform, as well as how you can begin using the app right away.

Get Started

This Maps App repo is a Visual Studio 2017 Project that can be directly cloned and imported into Visual Studio 2017 or higher.

Fork the repo

Fork the Maps App repo

Clone the repo

Once you have forked the repo, you can make a clone

Command line Git

Clone the Maps App cd into the maps-app-dotnet folder Make your changes and create a pull request

Configuring a Remote for a Fork

If you make changes in the fork and would like to sync those changes with the upstream repository, you must first configure the remote. This will be required when you have created local branches and would like to make a pull request to your upstream branch.

  1. In the Terminal (for Mac users) or command prompt (fow Windows and Linux users) type git remote -v to list the current configured remote repo for your fork.
  2. git remote add upstream https://github.com/Esri/maps-app-dotnet.git to specify new remote upstream repository that will be synced with the fork. You can type git remote -v to verify the new upstream.

If there are changes made in the Original repository, you can sync the fork to keep it updated with upstream repository.

  1. In the terminal, change the current working directory to your local project
  2. Type git fetch upstream to fetch the commits from the upstream repository
  3. git checkout master to checkout your fork's local master branch.
  4. git merge upstream/master to sync your local master' branch with upstream/master. Note: Your local changes will be retained and your fork's master branch will be in sync with the upstream repository.

Configure the app

Maps app uses authenticated ArcGIS Online services for routing and geocoding. You need to configure the app for OAuth authentication.

  1. Log in to developers.arcgis.com.
  2. Create a new application.
  3. After creating the application, navigate to the 'Authentication' tab and add a redirect URI. Any URI should work, but try to choose something unique to your app, like my-maps-app://auth. The default value in the app's code is https://developers.arcgis.com, so you can use that as an interim value while evaluating the app.
  4. While on the 'Authentication' tab, note the Client ID and the Redirect URI you specified.
  5. In Helpers\Configuration.cs within the MapsApp.Shared project, replace the default client ID and Redirect URI with the values noted earlier.

Requirements

Resources

Issues

Find a bug or want to request a new feature enhancement? Let us know by submitting an issue.

Contributing

Anyone and everyone is welcome to contribute. We do accept pull requests.

  1. Get involved
  2. Report issues
  3. Contribute code
  4. Improve documentation

MDTOC

Generation of this and other documents' table of contents in this repository was performed using the MDTOC package for Atom.

Licensing

Copyright 2019 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

https://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.

For information about licensing your deployed app, see License your app.

maps-app-dotnet's People

Contributors

esreli avatar mikewilburn avatar nathancastle avatar ncastle1 avatar zwaap avatar

Stargazers

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

Watchers

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

maps-app-dotnet's Issues

Search result overlays search bar in Xamarin Forms Android

When getting the search result on Android, the result bar does not fully cover the search bar, resulting a funky UI:

xamarin-forms-android-search

This is going to be soon addressed in re-design of the search UX/UI, so we'll resolve and verify this issue with that update.

Give access to the reverse geocoder when app is run on platforms not supporting touch input

When the app is run on desktops not supporting touch screen input, allow the reverse geocoding functionality to be prompted with a map click.

I recently ran into this on UWP and WPF when testing the app on Parallels for Mac. It would be nice for the app design to provide a consistent set of functionality regardless of whether touch input is supported.

This is a nice-to-have and not a must-have piece of functionality.

Add zoom behavior when tapping current location button

For most app designs which incorporate a current location or show location button within a map display, the behavior exhibited by tapping the icon usually zooms to the current location in addition to panning the map extent to center on the current location. We should add this zoom to functionality to the Maps App button as well.

Map extent is not always centered on target location

This behavior isn't totally consistent, but it does occur some of the time. It sounds like it's fixed in a more recent version of the API, so let's use this issue to remind ourselves to verify there.

This behavior occurs in two situations:

  1. When entering the address or place name in the search bar, and
  2. When tapping the current location icon

In either case above, the expected result is for the map to be entirely panned/zoomed to the new location and have it centered within the view extent. Instead, the target location is often still well beyond the map extent.

When using the current location feature, tapping it a few more times will often finally center on the true location.

This behavior becomes more egregious the farther the current map extent is from the next intended map extent.

This is not specific to any particular platform and occurs - as far as I have seen - across Android, iOS, UWP, and WPF.

Start and end addresses become obscured while editing them on Android

I've only tested this in Android so far. It may be an issue on other platforms.

Steps to repro:

  1. Pick an address and route to it.
  2. Click the start or end location to modify it.

Observations:

  • In Portrait mode - notice that the screen elements shrink in size so that the start and end text become partially obscured.
  • In Landscape mode - notice that the screen elements shrink in size so that they become totally obscured.

Example in Landscape mode:
landscape1
landscape2

Geocoder suggestions don't appear for UWP app in some environments

On UWP, typing into the search bar does not yield any auto-suggested results in some environments.
This prevents testing workflows such as routing and verifying the existence of a turn-by-turn locations screen.

Note: this appears to be specific to the UWP app and only occurs in certain environments:

  • Failed for Mike on a Mac running Windows under Parallels
  • Worked for Mara on a Windows on a PC natively
  • Worked for Rich on a MacBook running Windows under Parallels and natively
  • Failed for Rich running Windows on a PC (HP Spectre XT) natively

On UWP:
image

Same workflow on WPF:
image

Edit (Rich 4/4/18): Updated title and description to be more environment-agnostic - i.e. to specify that this issue is not limited to running under Parallels. Also listed all instances of the issue being tested and present or not present.

WPF version of the app cannot be run on Win7

When double-clicking to run the MapsApp application on a loaned Windows 7 VM, the WPF version of the app immediately encounters this error:

image

Here are the problem details:

Problem signature:
  Problem Event Name:	CLR20r3
  Problem Signature 01:	MapsApp.exe
  Problem Signature 02:	1.0.0.0
  Problem Signature 03:	5a3d6ce8
  Problem Signature 04:	Esri.ArcGISRuntime
  Problem Signature 05:	100.2.0.1912
  Problem Signature 06:	5a31dfd6
  Problem Signature 07:	2fa
  Problem Signature 08:	0
  Problem Signature 09:	System.Windows.Markup.XamlParse
  OS Version:	6.1.7601.2.1.0.256.4
  Locale ID:	1033
  Additional Information 1:	0a9e
  Additional Information 2:	0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:	0a9e
  Additional Information 4:	0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\windows\system32\en-US\erofflps.txt

Guide developers through getting sign-in working

In order for sign-in to work, Configuration.AppClientID must be specified with a valid developers.arcgis.com client ID, and the value specified for Configuration.RedirectURL must be specified in the list of redirect URIs for the application. In trying to get this working locally, this didn't seem clear. I would suggest:

  1. Spelling this out in the doc in an easily discoverable way.
  2. Adding a check during sign-in to point the developer to these values. This could, for instance, check for the default value of AppClientID and call that out specifically if unchanged, and otherwise suggest checking these values on sign-in failure.

Selecting a new basemap from the picker will zoom the map extent to a global view

When picking a different basemap from the basemap gallery, your selection will refresh the map view and zoom out to a global extent. This is in place of preserving the current extent/scale.

i.e. on iOS:
xamarin-forms-ios-basemap-zoom

Qualifier: this only seems to happen if and only if you've interacted with the map by panning or zooming before making your basemap selection. If you do this right from the default extent when the app launches, the new basemap will be added with the same extent and zoom scale preserved.

Asking for routing directions while not logged in brings the app to an unresponsive state on Android

This behavior turned up while testing on an Android device. I was able to reproduce it several times. (This may or may not be specific to Android.)

Steps to repro:

  1. Enter an address to which you'd like to route (i.e. West End Bikes)
  2. Click the 'Route' button which appears near the bottom of the UI
  3. Once brought to the authentication page, click the Android back button to decline entering credentials

The app continues to display a "Requesting Route" message with a progress spinner but there is no other apparent way to dismiss the action. The only way I've found around this is to totally close and re-open the app.

App architecture

Architect app to account for responsive UWP UI and maximized shared logic between Xamarin Forms and WPF

Tapping the 'Address or Place' bar adds horizontal lines to the display on iOS

In what appears to be an iOS-only issue, whenever the user taps the 'Address or Place' bar to search for a place name or enter an address, the app preemptively displays horizontal lines where the relevant search results will be listed. This occurs before the user has entered anything and before those results even appear.

screen shot 2018-01-04 at 3 12 26 pm

They also remain even when not necessary:
screen shot 2018-01-04 at 3 15 18 pm

Results returned from search become unresponsive to touch input

I've seen this on both Android and iOS, but am still narrowing down the more exact steps to reproduce.

When searching for an address or location, doing this enough times over can cause the UI to seem to become unresponsive to the selection of a particular result.

Android:
xamarin-forms-android-search-freeze

iOS:
xamarin-forms-ios-search-freeze

In neither case above does clicking the blue highlighted result (Android), or grey highlighted result (iOS) result in any feedback from the application.

When user logs out, unload web map

If a user is currently viewing a web map, then elects to log out of the account which gives access to the web map, we should remove that web map from the map.

We could do this by simply restoring the default map view when first starting up the app.

Changing basemaps after loading a user web map on UWP causes map display to behave erratically

I've only been able to reproduce this on UWP so far.

Steps:

  1. Sign in to the app
  2. Load one of the user's web maps
  3. Zoom to a location where data for that web map appears
  4. Select a new basemap to display

Based on some testing, it appears step 3 is essential to getting the odd behavior. If I preserve the map extent to an area where the web map does not show data/layers, changing basemaps seems to work fine.

Screenshot on UWP:
image

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.