Giter Club home page Giter Club logo

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

ArcGIS Maps SDK for Qt Samples

Overview

The repo contains Qt projects for each sample that can be run from within the Qt Creator IDE. It also contians source code to build and run the C++ and QML sample viewer apps locally.

Table of Contents

  1. Prerequisites
  2. Set up the ArcGIS Maps SDK for Qt samples repo locally
  3. Open a sample project file in Qt Creator
  4. Build and run the ArcGIS Maps SDK for Qt Sample Viewers locally
  5. Use a previous version
  6. Use offline data in the samples
  7. Resources
  8. Issues
  9. Contributing
  10. Licensing

Prerequisites

Set up the ArcGIS Maps SDK for Qt samples repo locally

Fork the repo

If you haven't already, fork the repo.

Clone the repo

How to clone a forked repository

Clone the sample code repo

Open your terminal, navigate to your working directory, use git clone to get a copy of the repo.

# Clone your fork of the repository into the current directory in terminal
git clone https://github.com/YOUR_USERNAME/arcgis-maps-sdk-samples-qt.git

Clone the toolkit repo

Change directory into your locally cloned samples repo and then use git clone to get a copy of the ArcGIS Maps SDK for Qt Toolkit.

# Change directory to the clone of the samples repository
# Clone the toolkit repository into the current directory in terminal
cd /arcgis-maps-sdk-samples-qt
git clone https://github.com/Esri/arcgis-maps-sdk-toolkit-qt.git

Cloning the toolkit in this location will allow for the samples to automatically pick it up. If you wish to place the toolkit in another location, you will need to update the samples project file accordingly to locate the necessary .pri file.

Configure remote upstream for your fork

To sync changes you make in a fork with this repository, you must configure a remote that points to the upstream repository in Git.

  • Open a terminal (Mac users) or command prompt (Windows & Linux users)
  • List the current configured remote repository for your fork
$ git remote -v
origin https://github.com/YOUR_USERNAME/arcgis-maps-sdk-samples-qt.git (fetch)
origin https://github.com/YOUR_USERNAME/arcgis-maps-sdk-samples-qt.git (push)
  • Specify a new remote upstream repository
git remote add upstream https://github.com/Esri/arcgis-maps-sdk-samples-qt.git
  • Verify the new upstream repository
$ git remote -v

origin https://github.com/YOUR_USERNAME/arcgis-maps-sdk-samples-qt.git (fetch)
origin https://github.com/YOUR_USERNAME/arcgis-maps-sdk-samples-qt.git (push)
upstream https://github.com/Esri/arcgis-maps-sdk-samples-qt.git (fetch)
upstream https://github.com/Esri/arcgis-maps-sdk-samples-qt.git (push)

Sync your fork

Once you have set up a remote upstream you can keep your fork up to date with our samples repository by syncing your fork.

  • Open a terminal (Mac users) or command prompt (Windows & Linux users)
  • Change to the current working directory of your local repository
  • Fetch the branches and commits from the upstream repository. Commits to main will be stored in a local branch, upstream/main.
git fetch upstream
  • Check out your forks local main branch
git checkout main
  • Merge changes from upstream/main into your local main branch which syncs your forks main branch with our samples repository.
git merge upstream/main

Open a sample project file in Qt Creator

Start Qt Creator. When the IDE opens to the Welcome screen, click on the Open Project button and browse to a project file (.pro) within your forked repo location. Configure the project, set your ArcGIS Developer API key in main.cpp, and run the sample.

Build and run the ArcGIS Maps SDK for Qt Sample Viewers locally

Start Qt Creator. When the IDE opens to the Welcome screen, click on the Open Project button and browse to either sample viewer's project file (.pro) within your forked repo location. The sample viewer project files are located at arcgis-maps-sdk-samples-qt\ArcGISRuntimeSDKQt_SampleViewers\, in either ArcGISRuntimeSDKQt_CppSamples or ArcGISRuntimeSDKQt_QMLSamples. Configure the project, set your ArcGIS Developer API key in ArcGISRuntimeSDKQt_Samples\SampleManager.cpp, and run the sample.

NOTE: the sample viewer project files search for the toolkit.pri at the default location specified above. If you cloned the toolkit repo to a different location, you will need to update the path in the respective sample viewer's project file.

Use a previous version

The main branch contains samples for the current, most up-to-date version of ArcGIS Maps SDK. To access previous versions, you can checkout by a tag or commit, or alternativley you can download the source zip: https://github.com/Esri/arcgis-maps-sdk-samples-qt/releases.

Use offline data in the samples

Some of the samples consume offline data, including TPKs, VTPKs, mobile geodatabases, and mobile map packages, among other data formats. If the sample does consume offline data, the sample's associated readme.md will note where you can download the data (from ArcGIS Online), and where the data can be placed once downloaded. For example, it may say something like:

Link Local Location
Los Angeles Vector Tile Package <userhome>/ArcGIS/Runtime/Data/vtpk/LosAngeles.vtpk

In this case, you would download the VTPK from the ArcGIS Online Location, and place it in a specified location. This location is the path returned by QStandardPaths::writableLocation(QStandardPaths::HomeLocation) from the Qt QStandardPaths class. <userhome> is used throughout to denote a generic location on the different platforms. The below table specifies where this is on all of the supported platforms:

Platform Userhome Location Example Location
Windows %userprofile% C:\Users\Bob\ArcGIS\Runtime\Data
Linux ~ /users/bob/ArcGIS/Runtime/Data
Mac OS X ~ /Users/Bob/ArcGIS/Runtime/Data
Android <APPROOT>/files <APPROOT>/files/ArcGIS/Runtime/Data
iOS <your app bundle> <appbundle>/ArcGIS/Runtime/Data

Resources

Issues

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

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Licensing

Copyright 2020 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.txt file

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

Contributors

acmorris avatar aji13187 avatar anmacdonald avatar chrisfrenchpdx avatar dian9181 avatar donmoja avatar ecmorris avatar guillaumebelz avatar jamesmballard avatar jared-2016 avatar khajra avatar ldanzinger avatar lsmallwood avatar markjdugger avatar mfeigl avatar mikewilburn avatar nandinirao avatar noahmulfinger avatar patrickarlt avatar ryankim86 avatar ryankim923 avatar sbiswas96 avatar tanneryould avatar tdunn avatar thadt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arcgis-maps-sdk-samples-qt's Issues

Replace usages of `calloutContent`.

The following samples use Callout.calloutContent properties:

  • IdentifyRasterCell (CPP/QML)

  • IdentifyKmlFeatures (CPP/QML)

It is my intention that Callout.calloutContent is to be deprecated, and replaced with Callout.contentItem, which does not require a Component wrapper, or workaround code to deal with widths/heights. E.g this code:

    Callout {
            id: callout
            calloutData: view.calloutData
            autoAdjustWidth: false
            calloutWidth: 300
            accessoryButtonHidden: true
            leaderPosition: leaderPositionEnum.Top
            calloutContent: customComponent
        }

        Component {
            id: customComponent

            Text {
                text: model.calloutText

                Binding {
                    target: callout
                    value: contentHeight + 15
                    property: "calloutHeight"
                }

                wrapMode: Text.WordWrap
                textFormat: Text.RichText
            }
        }
    }

Should ideally become this:

    Callout {
            id: callout
            calloutData: view.calloutData
            autoAdjustWidth: false
            calloutWidth: 300
            accessoryButtonHidden: true
            leaderPosition: leaderPositionEnum.Top
            contentItem: Text {
                text: model.calloutText
                wrapMode: Text.WordWrap
                textFormat: Text.RichText
            }
    }

This ticket covers updating the linked samples with the new workflow.

Is QT Creator the only option? Do samples work in Visual Studio 2019?

Good day folks, just wondering while I play with the samples in QT Creator. Can we load these in Visual Studio 2019 as it's not working for me. I used the QT VS Tools open .pro option and get all sorts of errors when it completes. Here's a few that pop up:

Error (active) E1696 cannot open source file "ArcGISRuntimeEnvironment.h"
Error (active) E1696 cannot open source file "QDir"
Error (active) E1696	cannot open source file "QGuiApplication"
Error (active) E1696	cannot open source file "QQmlApplicationEngine"
Error MSB4094 "SketchOnMap.h;SketchOnMap.h" is an invalid value for the "Item" parameter of the "GetItemHash" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem".	

I'm familiar with VS since my childhood and is QT Creator the only way to use these samples?

Thanks again for any tips / help.

Error while running TileCacheLayer in arcgis-runtime-samples-qt

While running TileCacheLayer on Qt, I got the blow error-

C:\Users\HP\Downloads\arcgis-runtime-samples-qt-main\arcgis-runtime-samples-qt-main\ArcGISRuntimeSDKQt_CppSamples\Layers\build-TileCacheLayer-Desktop_Qt_5_12_12_MSVC2015_64bit-Release\release\TileCacheLayer.exe crashed.

The project was built successfully but there is a problem while running.

Below are the Qt details:

Compiler: Qt_5_12_12_MSVC2015
Based on: Qt 5.15.2
Qt Creator 5.0.2

GenerateOfflineMap sample doesn't work.

Hi there,

I'm trying to generate an offline map using GenerateOfflineMap qml example, the problem is that when I run the program, a window pops up with no content and I get this in QtCreator's application output:

QML debugging is enabled. Only use this in a safe environment. Esri.ArcGISRuntime.Plugin: virtual void ArcGISRuntimePlugin::registerTypes(const char*) Esri.ArcGISRuntime Esri.ArcGISRuntime.Plugin: static void QmlUtils::registerTypes(const char*) Esri.ArcGISRuntime Empty filename passed to function Empty filename passed to function

Can you tell me what's exactly the problem.

unable to load XML in WMTS

Hi,
I am trying to run WMTS sample. i am using this xml for getCapabilities in below URL:

https://api.lantmateriet.se/open/topowebb-ccby/v1/wmts/token//?
request=getcapabilities&service=wmts
your-token = 172d422a3e65e5010d95ac5fc27eda

When i am using this in browser, its giving me proper xml response,BUT in app swift code says invalid XML provided (For Ref: find attached Image below)

Please guide about that how to handle "getcapabilities" in Swift for URL because in sample code for JavaScript its Obvious but not clear for Swift Coding.

We are waiting for early response.
Thank You.
whatsapp image 2018-12-06 at 6 25 47 pm

Viewing offline tiled maps in Qt

Is it somehow possible to view offline tiled maps (downloaded in a directory {/z/x/y.png} ) using one of the projects here. If so, kindly help me with the correct project name.

Thanks

Runtime Local Server: Input Feature Set is shown as GPString not as Feature Set?

We tried to use the Local Server GP Sample with a ArcGIS Pro based Geoprocessing Package having features as input parameter. The local server shows the feature input parameter as GPString.

We could not reproduce this in ArcMap 10.8.1. Is ArcGIS Pro creating incompatible Geoprocessing Packages? Any help would be appropriated.

The complete discussion:
Runtime Local Server: Input Feature Set is shown as GPString not as Feature Set?

example not working 'GraphicsOverlayDictionaryRenderer_3D'

arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/GraphicsOverlayDictionaryRenderer_3D

Luke Smallwood gave access to the required xml file which is unfortunately NOT included in the github.
Mil2525DMessages.xml (md5: 20d2386c92976eb43007e38f31d63795)

I build that example
a) using the qtcreator
b) on the cmdline: qmake, make

related to a)
The example executes, but where are the objects?

related to b)
on execution i got a seg fault:
Using this the example crashed:

Program received signal SIGABRT, Aborted.
0x00007ffff4d6dcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff4d6dcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007ffff4d710d8 in __GI_abort () at abort.c:89
#2 0x00007ffff4d66b86 in __assert_fail_base (fmt=0x7ffff4eb7830 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=assertion@entry=0x7ffff09cda45 "(-(e)) != 3 || !robust", file=file@entry=0x7ffff09cda28 "../nptl/pthread_mutex_lock.c", line=line@entry=350,
function=function@entry=0x7ffff09cdb40 <PRETTY_FUNCTION.8671> "__pthread_mutex_lock_full") at assert.c:92
#3 0x00007ffff4d66c32 in __GI___assert_fail (assertion=assertion@entry=0x7ffff09cda45 "(-(e)) != 3 || !robust",
file=file@entry=0x7ffff09cda28 "../nptl/pthread_mutex_lock.c", line=line@entry=350,
function=function@entry=0x7ffff09cdb40 <PRETTY_FUNCTION.8671> "__pthread_mutex_lock_full") at assert.c:101
#4 0x00007ffff09c0ce1 in __pthread_mutex_lock_full (mutex=0xc327d8) at ../nptl/pthread_mutex_lock.c:350
#5 0x00007ffff37ca3c6 in std::__1::mutex::lock() () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#6 0x00007ffff1d43030 in ?? () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#7 0x00007ffff1f8dbc8 in ?? () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#8 0x00007ffff1b39738 in ?? () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#9 0x00007ffff1f74dcf in ?? () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#10 0x00007ffff1f832e0 in ?? () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#11 0x00007ffff1f8631f in ?? () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#12 0x00007ffff1a612c0 in ?? () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#13 0x00007ffff1a60b63 in RT_Vector_add () from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libruntimecore.so
#14 0x00007ffff78f91c3 in ESRI::RuntimeCore::QRTVector::add(ESRI::RuntimeCore::QRTElement*) const ()
from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libEsriCommonQt.so
#15 0x00007ffff7671a09 in QRTImpl::ListQRTImpl::GraphicImpl::append(std::shared_ptrQRTImpl::GraphicImpl const&) ()
from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libEsriCommonQt.so
#16 0x00007ffff770ac93 in QRTImpl::GraphicListImpl::append(std::shared_ptrQRTImpl::GraphicImpl const&) ()
from /home/quartzfinal/arcgis/runtime_sdk/qt100.0/sdk/linux/x64/lib/libEsriCommonQt.so
#17 0x0000000000496bb5 in Esri::ArcGISRuntime::GraphicListModel::append(Esri::ArcGISRuntime::Graphic*) ()
#18 0x000000000047293b in GraphicsOverlayDictionaryRenderer_3D::createGraphic (this=0x844780, rawAttributes=...)
at ../GraphicsOverlayDictionaryRenderer_3D_Symbology/GraphicsOverlayDictionaryRenderer_3D.cpp:174
#19 0x0000000000472368 in GraphicsOverlayDictionaryRenderer_3D::parseXmlFile (this=0x844780)

includes missing

Hello, running RasterLayerFile my project is missing:
#include "Map.h"
#include "MapQuickView.h"
#include "Raster.h"
#include "RasterLayer.h"
#include "Basemap.h"

i cloned the repo and launched .pro file in QtCreator, is something that i did not but had to?

Missing include

example 'ArcGISRuntimeSDKQt_CppSamples/Scenes/BasicSceneView/main.cpp'

There is an include missing: #include <qqmlengine.h>

Is it possible to draw custom objects(like smoke) on top of ArcGIS earth environment?

My question is in continuation of following issue,
#1050 (comment)

I tried to put a query on "Geonet" portal 4-5days back, but did not receive any response yet. Sorry, but this is quite an urgent requirement and your inputs will really help us take a better decisions.

Could you please provide more details about an option where you have suggested to draw polygon graphics in a GraphicsOverlay?
Ex. How do we handle pixel colors?

Could you please provide the exact API name(or reference) for the same?

Can you share some examples available, if there are any?

Any help would be really appreciated!

failed to find local server

when try to start local server button
the debugger output :
Starting server
Failed to find local server runtime in the following location(s):
/64/bin

How to build qt shared library ?

How to build qt shared library ?

My project

the app works perfectly if I build it as an app.

TEMPLATE = app

If I create a shared lib with same code the code not gives result.

I changed TEMPLATE = app to TEMPLATE = lib and I compile the same code. But , the result comes an error.

code not give result as a qt shared lib

wifimouse app fully build with qt.

Source code of wifimouse server application

I install and run wifimouse app in my computer it works perfectly and all the options are works smoothly.

But, If I compile the same code as a shared lib in my computer it not works properly.

For example ; In wifimouse application there is an option for brightness controling

Brightness code

enter image description here

error comes like this. But , it works smoothly as a TEMPLATE = app.

Problem with qt in getting outputs.

My project

I want to get the cpu usage , ram usage ,process list and app list with qt.

In Windows

windows os

I am getting ram usage from this code.

But app list , cpu usage and process outputs are not showed.

In linux

enter image description here

In linux the cpu usage output not showed.

In Mac

enter image description here

In mac the app list output not showed.

All the code works perfectly if I build it as an app.

Why this problem occured ?

Is it possible to draw custom objects(like smoke) using custom OpenGL 3.0 shader?

I am working on a project which uses ArcGIS Runtime SDK for Qt creator.
I want to draw custom objects like smoke on top of the earth environment provided by ESRI ArcGIS.
I tried to search through the documentation, but could not dig out a proper help.
Can someone please help me understand, whether it is possible to write our own OpenGL Shader?

BuildLegend demo crashes on startup

When I run the samples app and switch to the BuildLegend demo, the entire app crashes and disappears.
This happened on a Samsung Galaxy S10+ running Android 11.

I see this error in the LogCat:
2021-08-11 12:03:21.661 13887-15075/com.esri.arcgisruntime.ArcGISRuntimeSDKQt_QMLSamples A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 15075 (qtMainLoopThrea), pid 13887 (DKQt_QMLSamples)

looks like a bug in API.

Hello Team,

I have created a Dockable widget class and created map_view in it.

Its loading properly.

But when I double click to dock it out map view is coming as blank black screen.

Thanks,

vNext branch: Bug with speed slider on Animate3DSymbols samples (C++ and QML)

The interval property of Timer in Animate3DSymbols.qml should use Math.max instead of Math.min. Right now, the speed is always 1 no matter where the slider is positioned unless the slider is all the way to the right at which point it is 0. This is a bug in both the QML and CPP samples.
Instead of:

Timer {
        id: timer
        interval: Math.min(animationSpeed.maximumValue - animationSpeed.value,1);
        running: playButton.checked;
        repeat: true
        onTriggered: animate(animationSpeed.value);
    }

It should be:

Timer {
        id: timer
        interval: Math.max(animationSpeed.maximumValue - animationSpeed.value,1);
        running: playButton.checked;
        repeat: true
        onTriggered: animate(animationSpeed.value);
    }

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.