ArcGIS Runtime SDK for iOS and macOS: Building Apps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
my name is Davis Coyle I work on the run time development team at Essery but just to get situated with who's in the audience here how many of you here are new to our GS runtime say less than six months or a year okay but half of you and how many of you are new to iOS development all right many of you and will any of you be building apps with any of the other SDKs and ApS like JavaScript cute dotnet all right most of you probably and finally for how many of you does the first developer summit okay some of you will welcome just a word of advice it can get quite overwhelming with all of the sessions and Technology we have here so don't feel like you have to understand everything when you leave just have some idea of what the roadmap is and you know where things fit in and then you can always follow up with more questions after the conference so this is the agenda for today's talk I will be starting off with just an overview of run time because this is an introductory session we don't expect many of you to have used it on time and so we give you tips and advice and how you can get started and what resources are available for you to use run time has a lot of capabilities much more than I could cover in one session or even two session so what we typically do is have a session like this which is very generic in general and is like a gentle introduction from most of you but then we have deep dive on specific areas of runtime throughout the week so we have a session dedicated just working offline a session that you get it - editing 3d working with content from portals security so I'll point those sessions out at the end of my talks you can then figure out which ones you want to go into to learn more in depth on how to use those capabilities but in this session I'll keep it fairly high-level we will build an app just so you can see what it feels like to use the SDK and how you would build an app that displays a map and does some basic tasks like geocoding routing and I'll give you some tips along the way and point out some common patterns and practices you'll use in all of your app development so RJ's runtime is a tool for developers to build native apps these apps can provide the best performance because there aren't really close to the metal and take advantage of all the power and the CPU and the GPU that's available on the device you can use existing developer frameworks from platform providers like Apple Google Microsoft to build your apps for these platforms you can use capabilities from ArcGIS online or RGS enterprise or some of these capabilities runtime offers locally on the device without needing a connection to any of those two things and then you can build apps that work on a wide variety of devices and across all platforms and OSS like iOS Android Windows Linux and even embedded devices and one of the key benefits are using runtime is that you your apps can go offline and still be able to work with data and perform analysis even without network connection so the way we built our GS runtime is that we use C and C++ the reason for that is it gives us the best performance on the device but also it's a cross-platform and portable however we don't expose those C api's to you because that would be very difficult for you to build in your apps what we do is add a small veneer of api's on top of our core development so that app development becomes very familiar to people who building iOS apps or Windows apps and these ap eyes are native to the platform and use the tools and resources that are available on the platform the other advantage of building once in C and C++ is that we end up using the same conceptual model across all our different API is and SDKs so if you build nap with Android and you start building with iOS later on you'll see a lot of the same capabilities and patterns because they're all coming from deep within runtime currently we're on the hundred X series of releases for runtime this is a new generation of runtime that we started developing little over two years ago and in the past two years we've had a number of releases that have added capabilities and improved quality so the first release we've just was built on this new architecture of using a common core and provided basic mapping workflows that was 100.0 release and then with update 1 we added support for the 2d web GIS sort of using web maps and layer items from portals and introduced 3d support for mobile devices specifically in the last year we've had three releases 102 103 104 and all of the capabilities released in in those specific versions is available like I said across all the different runtime SDKs so runtimes really evolving and you know there's a lot of work going into improving it and making sure that meets your needs so come talk to us about what are some of the features you need to build your apps and we'll make sure that we prioritize the right way so that we can deliver those for you in releases coming out later this year in fact we have a release that's almost done the 105 release will be out end of the month hopefully but then we have a few more releases in the rest of the year last year we added support for mobile map packages and improved the way we work with local tiles and raster data inside mobile map packages we also added support for some offline analysis based on transportation networks such as finding a closest facility or deriving a service area of which is basically drive times of areas you could get to and all of that works offline we added support for web scenes so now you can author these scenes using ArcGIS online or Enterprise and then consume them very easily in your runtime based apps and we improved some of the 3d workflows like being able to identify and select features and 3d layers or do distance measurements and also support a variety of different data formats like KML and mr. Sid drafter we added support for some symbology types specifically the military symbology AB 6b and 6d and improved support for Arcade expressions that are used all across the platform for things like symbology to pop-ups to labeling and we also improved our support for feature layers and allowing you to do edits within a transaction and page through results and better handle subtypes so I mean there are a lot of capabilities in runtime and one of the best way to experience those is using some of the sample viewers that we provide so if I go ahead the code for the sample viewers is available on github but you can also download the iOS sample viewer from the App Store just look for our GS runtime SDK samples and I'm going to go ahead and switch over to my iPad now and here I've already downloaded the samples to my device I go ahead and launch it just as I kind of I need to just update the settings on this so you can see the touches so you can see we have samples covering a wide variety of categories for things like displaying maps which is pretty basic but also things like changing the background of a map for instance by default you get a great grid in the background but you can easily interact with this and change the line width size of the background grid and also the color and the great thing about the sample viewers is that if you like some of the functionality that you want to use in your own app you can go ahead and dive into the chord right in the app and see how easy it was to implement this and borrow code snippets from the app and you can also get the code for this app from github to give you another example here we have a map that you can sort of bring up a magnifier on and see better what imagery it's displaying if I jump into the layers category you'll see we have support for a wide variety of different layers that allow you to bring data from different data sources so I can display things from tiles or for instance vectors tile services if I go ahead and launch one of these samples you can see that the cartography in the symbology works really well on these native devices with high DPI and it's really fast as a pan and zoom around you can see I'm getting really good framerate and it's really fluid panning and because it's all vectors which are being drawn natively on the device you can see the labels they face up as I rotate the map so it works really well here's an example of support for KML that we added recently into the SDK this is a map that shows some weather conditions across the country and you can see that right now in the santa barbara county they're experiencing flash flooding and here's another sample that shows kml which has network links and this is live data showing flights in the sky around the Schiphol Airport in Amsterdam we've got many other categories for instance working with features the display information has some really cool samples for instance this one that allows you to tap on the map to start sketching and you can go ahead and select one of these vertices and move it around if you wanted to sketch freehand we we have ability to do that like sketch a polyline or create a polygon and then you can go ahead and move it around or change its shape and things like that and you can also undo and redo so the question is are these all widgets most of them are API is very high-level API is that you can call that will do most of the work for you but we do have something like widgets that we call toolkits and I'll show you that a little later on in the session we've got samples that show you how to edit data route geocode and also display three scenes that work really well on these iOS devices and you can use fluid gestures just sort of word pinch zoom N and also tilt the camera and not only do we have those samples on iOS we also have them for the Mac so I'm gonna go ahead and jump out of this presentation you can see this is an app that we built using the Mac SDK it's got those same categories and a bunch of samples here for instance I can I can do some analysis on a scene for instance let's go ahead and load a scene and I'm gonna go ahead and tap on the map and then then drag my cursor around and what it's doing is its computing a line of sight which which tells you whether a observer can see the target and when the line is green that means that they're both in view but as I move behind this hill face you can see that the target is no longer visible and the line of sites become red in that case so this is all interactive I can do very easily I can also compute line of sight dynamically instead of interactively just by looking at what features I have on the map and by defining an observer location so for your example I have an observers porch somewhere on a building he was looking at a car going around the city and I can see that right now the cars behind the building so the observer cannot see it but if I were to change the observers height then things become a little bit more visible we have some samples that show you can work with geometries for instance this is an example of a map that allows you to show geodesic distances between two locations meaning it follows the curvature of the earth it is not just a straight line like you would have an O flat map and again you can see the source code for this Mac app just inside and see how we built these samples and borrow heavily yeah so the question is is the code of for iOS and Mac OS the same and the answer is yes I mean 99% of the code that you write for iOS is what you can use on Mac OS because we use the same types the only difference comes when you work with the UI Apple requires you to use different UI frameworks on iOS and Mac so the button on a Mac is different from button on iOS but when it comes to ArcGIS runtime api is the API is exactly the same so that was just a quick tour about the different capabilities available in run time that you can experience through our samples but if you wanted to start building your apps with this has TK what do you need well first off you'll need a Mac because the SDK builds on top of apple technology you need to use a Mac to build your apps that's something that Apple prescribes you also need to use Xcode which is the IDE that apple provides to do iOS and Mac development you can download it free from the Mac App Store and you you can use Xcode 10 or you can use Xcode 9 10.1 is the latest version you can use that to any version of 10 or 9 is OK you'll need to get a free Apple Developer account so you can deploy your apps to your device for testing and you need to get a free ESRI Developer account or if you have an ArcGIS online account you can use that so that you can download the SDK and start using it the latest version of argyus runtime available is version 104 that was released in the winter using that version of the SDK your apps can target a mud number of different oases for instance on iOS you can target the latest OS which is 12 and go all the way back to iOS 10 if you look at the latest stats that are published by Apple just the two most recent versions of the US iOS 12 and 11 cover almost like 95% of the in devices out there so you're more than covered with these versions of the OS that we support and for Mac we support three versions going back to Sierra but also support the latest Mojave version and you can use either Swift or objective-c to build your apps the API that we provide you is an objective-c API because Swift still does not have backwards compatibility so we couldn't give you an SDK that worked from release to release of Xcode we'd have to release it every time Xcode came out with the new version but hopefully Apple is going to change that later this year they've been targeting providing binary compatibility for a couple of years now and this year they say it's going to be available yeah so we support both Swift and objective-c quick show of hands how many of you use Swift for your app development and how many use objective-c oh yeah there's a few of you we still support objective-c so you can use that because it's an objective-c API all of our samples however are in Swift we just can't bring ourselves to writing Objective C code anymore so where do you get the SDK from do any of you use cocoapods show of hands some of you do yep so the SDK is available on cocoa pods you just put the name of the SDK in your pod file and give it optionally a version number to pod install and it is downloaded and configure your Xcode project to start using it it's pretty simple but for those of you who don't use it you can get the SDK from developers dot-com and you can download an installer package you just go ahead and install that package and it'll put the libraries on a central location on your Mac and then when you start developing your apps you'll need to configure your Xcode project which is just as simple as dragging that library into the embedded binary section of your project and that's it you're good to go so it isn't too much more work but I do know that a lot of people don't prefer cocoa pods because it does a lot of magic behind the scene to configure the Xcode project just to note here what you you'll see that when you install the SDK depending on whether you use cocoapods of the installer there it is a fairly large SDK the libraries are little over one gigabyte and the reason for that is the library that we provide because it supports all the way back to iOS 10 we have to support the 32-bit architectures are on v7 and also the new device is a 64-bit architecture and the library contains binary for both of those but because you use the library for development and most of the times you're using a simulator the library also contains some binary for the simulator so there are three architectures in it and when you add bit code to the mix for each of those architectures it becomes really big but that's just the size you will see as a developer when you install the SDK or user in your project when you compile your apps all of that gets compacted and optimized so your apps are nowhere near that size the size of your app really depends upon whether you're deploying a universal app or a thin app apple's recommending everybody go the route of a thinned app the benefits are that when your apps deployed on a device it only contains the architecture and the resources required for that device and when you build a thinned app with the argyus runtime SDK the deployment size of that due to the runtime is about 25 Meg's and when its installed on the device it's about 75 max there's a great Apple technical Q&A I put the number up there so you can google it later that talks about how you can thin your apps and how you understand the size of your app before you deploy it to the App Store and that's what we've used to come up with these numbers and these numbers change with each version of the SDK as we add more capabilities this sort of inch higher but that's the size that we had with the 104 SDKs so once you've downloaded the SDK what do you do will the best place for you to go is developers RGS comm and there's a bunch of resources available there that I'll show you just now so here we are on the landing page of developers or our geo comm you can see we have quick links to all of our different SDKs and the resources available for that but if you just scroll down on the web page you'll see that all of the capabilities that are available on the RGS platform to developers things like using ready-to-use maps and data to spatial analysis and working offline if I go ahead and click on iOS you go to the iOS SDK home page you'll see that there are a number of dev labs that we make available these are like short 10 15 minute tutorials that you can use for instance how do you create a starter app how do you add layers to your map and there's a lot of information background information of what you'll be doing in each lab we give you a starter app that you can start writing code and we show you all the code you need to write and then we can also give you a completed solution if you're just lazy and don't want to go through the lab you can just run it so it's there and then we you can string the number of these labs together to sort of build a more functional app so definitely check out the dev labs it's a great way to sort of learn about how you can use the SDK if I go back to the home page and scroll back up to the top now someplace that you probably want to read through is the guide we put a lot of effort into providing conceptual doc about the SDK so we covered a lot of fundamentals for instance this one talks about what are the offline capabilities and patterns that you can use and you can see that as I scroll it's it's pretty involved because there are a number of ways you can do things this one talks about geometry model you'll notice with the latest version of runtime our geometries are immutable that means once you've created a geometry object you cannot modify it anymore and the reason for that is it allows us to get the best performance if most of our engine rendering engine and analysis engine don't have to worry about geometries changing on them they can cache things and make some safe assumptions the guide topics have code snippets that show you how to use some of those API is as I walk you through the concepts and then you'll see it's organized the same way that our sample viewers were talking about map scene displaying information performing analysis and then there's a section there when you are ready to release your app to think about how you want to license it and what are the different licensing capabilities and options available to you you should also look at the reference section apart from release not telling you what's new in every version of the SDK we we also give you information about things like error corbs so when you're doing something with the API and things fail chances are you'll get a helpful message but there are cases where there are no helpful message and all you'll get back is a code so you can scroll through this document and look at the chordal what the descriptions are and we keep this document updated as we come across more chords that we want ourselves aware of so it's a moving target so that's the guide documentation we have a really good API reference talk for instance here or all the classes I think we had like maybe last 150 classes so there's a lot of API is for you to work with but if I look at one high level class which is layer you can see that there's an object model diagram there that shows you all the different types of layers we have available scene layers vector tile layers feature layers etc and there's some really good documentation for all the properties on these things so definitely check out the API reference doc we put a lot of content in there that you need to know about we also have information here about what api's are available at what license level so that as you're developing you can you know when you're developing in developer mode you have all the APS work it's only when you go to deploy that you need to worry about licensing so this this information puts it right front and center for you we have a tab that sort of shows you all the samples we have the ones that I showed you in the app we also provide them on the website in case you want to search for them and then also check out the support forums there's a lot of good discussions happening in geo net where users like you ask questions and members from the dev team sort of monitor those discussions and try to provide answers and ideas on how to do things so definitely use that as a resource but sometimes the best way to learn about the API is just just start playing with it and get a feel for it and if you download the installer package that I talked about earlier what we do is we provide a playground project with that and playgrounds a new type of project that Apple's introduced in the last couple years which Allah gives you a rapid prototyping environment where you don't need to build an app you can just write some code and see the results for it in real time so this is that playground project that I was just talking about so you can write a line of code and run it and see what comes back so what I can do is I'll go ahead and create a point object and I'll give it a lat/long representing Palm Springs and if I hit the play button here playground is going to evaluate it and look at my code and show me the result in near-real-time next to that statement so here a point objects been created with that information if I wanted to display this point on a web Mercator based map I'll have to project it so what I can do is I can use the geometry engine to project it go ahead and create another point that is using the geometry engine and I'll call the project method I'll take my original point and I'll projected to the web Mercator spatial reference and if I hit play you can see now I got back another point which has different coordinates this is in the Cartesian coordinate space if I wanted to buffer this I could say thank you and I can buffer it by let's say 5,000 meters and this time us I got a force and rapid I get back a polygon and then I can use the geometry engine to get the area of that polygon and that's a large number in meters so it's a really easy way to start experimenting with our API and see what you get back but many times what you'd want to do is you'd want to see a map and the playgrounds allow you to do that a little bit too so what I've done here is I've created a map view I've given it a frame and given it a size of 400 and I've set the map view as the current view of my playground page if I go ahead and switch to the assistant editor mode and hit play you see I get a empty map view then I can start adding content to it before I do that let me just jump back to the slide the latest generation of our GS runtime the hundred x-series users use a MVC pattern a Model View controller pattern to differentiate between what you're seeing on screen and the data that you're working with so typically what you do is you start with something called a map or a scene and this represents the model component of that MVC architecture and the basically the data that you're going to be seeing a Maps made up of base map which provides context and is the lowest level that you see and on top of that is some operational layers the scene is very similar except scenes also got a surface that sits below the base map to give it an elevation and terrain that you'd expect in the real world and to display these things in your app you need to create a map view or a scene view and given that model component so pure we'd created the map view now what we'll do is go ahead and create a map we'll set the base map on it in this case I'm using the topographic based map from RJ's online and I'll add an operational layer in this case I'm creating a feature lab that's connecting to this feature service and I'll add it to the operational layers collection of the map and then I'll set the map onto the map view and there I've got a map you in playground that I can go ahead and sort of interact with but if I want to zoom to a certain location in code what I can do is I create a view point with the center and scale and then set the view point oh I'm sorry I am on the right one power point how's this so let's do that again so what I did was I hit I basically created a map with some operational layers and a base map and then I set the map on the map view that's my map view that I can sort of interact with but I can also set a view point on the map view to go ahead and zoom in to a certain location so that's displaying a map but if I wanted to display a scene I just use a scene view and a scene instead so let me go ahead and change this I go and change this to a scene view I'll change this definition this variable name to a scene view instead of a map I'll create a scene I'll change this variable name to a scene set the base map some operational layers and that's it and now if I run it oh I need to change scene V dot scene is equal to scene if I run it fingers crossed I should see a scene view in my playgrounds it's loading there it is there's a 3d scene view I can go ahead and set up your point zoom in the animations are a little choppy and this is where playground sort of hits a wall it's very hard to interact with it because there's a lot of graphics being used behind the scenes so it's great for rapid prototyping but not something you really want to develop your apps with when you're working with maps and scenes so this is just a straight down view on a scene view but I can go ahead and change the camera so what I can do is I can set a heading of 180 so I'm looking south and a pitch of 75 so that I have a perspective view on the scene and now we've sort of tilted the camera so we're looking at in 3d space but you can still see the worlds pretty flat and I can fix that by adding a surface to my scene view basically I'm using this elevation service from our json line i create a surface and add it as a tiled elevation source and set it on my scene and now you can see the hills behind they have sort of a relief and they're sort of elevated so it looks like a actual 3d scene sorry this elevation layer is provided by our GS online we provide some world elevation by default yes yes but you can publish your own elevation using our GS Pro and enterprise it's just an image service so that's a quick tour of playgrounds and how you can rapidly write code and prototype with the SDK but like I said interacting with the map or scene is very difficult sometimes when a lot of graphics are being displayed so what you really want to do is build an app so we've seen this slide just a tip when you build your apps make sure you test your apps on actual devices because the simulator can light you in two ways one the way case you saw it can make graphics look worse than they are because it's going through that simulated environment actual devices actually keep up with graphics a lot better but it could also make your cpu-bound code look a lot faster because the CPU of your machine is very powerful and it might be able to execute multiple threads at the same time but you put that same on thing on a device and it doesn't work as fast so you get false positives and false negatives so the only solution is make sure you put your app on the device and test on that make sure you test with real people not developers because for developers everything works especially when they've written the code and if you can find a user who'll be using your app try to get them and just see how they're interacting with your app and are they able to navigate your app correctly are they finding all the important things they need to do their workflow without having to dig into your the app and then try to test your app in real network connection conditions because if they're going to be using it in the field over very limited 4G connection then the Wi-Fi environment of your office is not going to show how that data loads for them okay so with that said let's build an app I won't actually deploy it to a device because I'll have to faff around with the projector too much but will it be fine for the simulator for this case we will show you how to do it it's pretty simple we'll just it's a hello world app we'll add a map to an iOS app and add some geocoding to it so here we go there's my simulator I need to scale this down okay there we go anyways so I have a storyboard open which is empty all I've got is a view in it what I can do is go ahead and drag another view on top a spinning wheel of death okay there it is I'll go ahead and use some auto layout to break it span the entire scene Oh and then I will go ahead and add a search bar to the top here and I will go ahead and add some layout constraints to that equal width and then okay hopefully that looks alright then the last thing that I need to do is just make sure that I wire up my outlets and delegates correctly so this one is going to be a map view so I'll give it a type AGS map view and i can go ahead and drag it on to my map you variable to connect it and then the search bar I'm gonna go ahead and drag it on to my search bar variable to connect that as well also I need to hook up the search bar delegate I'm going to go ahead and set that to my view controller with that I'm gonna go ahead and jump into code now now that my UI set up correctly and basically in the viewdidload section i have that same sort of code which is creating a map adding a feature layer and setting the map onto the map view let's go ahead and run this see how it looks now my map use auto layout constraints weren't right so it's you're at the bottom of my view and there's some white space but I have a search power in the right place let me see if I can fix that but before we do that let's add some code on how to geo code for the first thing I will need is I will need a locator task which I've created I'm using an RGS online located look geo code service but if I have a local data with a locator on disk I can give it a path to that file on disk and that way I can do geocoding offline I've created a graphics overlay that's going to hold my geocoding results for later I've added that graphics overlay to the map view and then this is the method that gets called when somebody enters text into the search bar and presses done so I want to write some code that will go out and use the locator service to do the geocoding just quickly run in through the code here what I do is I I take the search text from the search bar I make sure it's not nil and then I call the geo code operation on that locator task and I pass in that search text you'll see that after the the geo code operation is an async operation there's a block that follows it that block will be invoked once that async operation is complete so in that block I've written some error handling code to see if it never happened then just show some information and if not then go into the results that are passed into my block and get out the first result added to my graphics overlay and set my viewpoint to that result let's go ahead and run this again it says my map I can go ahead and search for Palm Springs Airport hit enter and there you can see it's geo coded the location and a data graphic on to my map view I need to fix the map view because not positioned correctly so let me just go back real quickly into the storyboard x-cart come on you know what let me let me quit Xcode and start it up again something's going horribly wrong yes live coding let's see does everybody know the command option escape yeah okay great you guys have been there all right okay let's look at the constraints and see yeah this shouldn't have 173 on top okay let's run that again okay yay all right so my map's going underneath my search bar which is which is great and aligning with the top of the search bar so now that we've geo coded let's go ahead and jump back into our view controller and add some code so that when we tap on one of those features from the feature layer we can display a call-out in some attributes in there the first thing I need to do is set the touch delegate for the map view so this way the map view will inform my view controller whenever user taps on it long presses or does a you know different kind of gesture on it then the next thing I need to do is implement the delegate method that will be called when a user taps on the map and that delegate method is called G of you did tap at screen point and it passes in the screen point which the user tapped and also the map point in the maps spatial reference what we do inside this method is we use a very nice helper method that the map you provide that says identify layers and we pass in the screen point that we got back and a tolerance and the map view goes ahead and looks at all the layers inside it and does queries and hit testing to find what features are available at that location again it's an async method so when it's done it invokes this block passes the results in error we dismiss the call of call out if we were previously showing it we do some error handling and then we go into the results and get the first feature out of it then we set the call-outs title to an attribute from the first feature called name and we set the detail to a value from the attribute called text for short description field these are the attributes that the feature service sends back with all of its features and then we call the simple method show on the call out to display it we pass in the feature for which way displaying it so anchored correctly on top of it and we also pass in the map point so if I go ahead and if I go ahead no and run the app now when I tap on one of the features from the feature layer I should be able to see their information in a call-out so I'll go ahead and tap on this guy and there you go call-out anchored right over that symbol with a name and detailed description the next thing I want to do in my app is is display my location on the map and also route to one of these points of interest that I pick when I hit the accessory button to do that I'm gonna go ahead and define a route task again I've created a route task with a URL to the world geocoding service I'm passing in some credentials from my ArcGIS online account that I want to use and I've created a graphics overlay that will contain the results and on the graphic overlay I've set a renderer they'll symbolize all the graphics I put inside it with a simple line symbol the next thing I've done is I've gone ahead and set up a delegate on my call-out so that whenever user interacts with that button in the call-out I get notified so that I can route the user to that location I've also changed the accessory button to this nice routing symbol instead of that bland information symbol and I've started location display on the map view so that I can display my location on the map now what I want to do is perform the actual routing when a user hits that accessory button in the call-out this is the method that the call-out will call did tap accessory button what I do inside that is I pull out the geometry of the destination feature that I want to route to so I get the point back like I initialized my route parameters and then I set the stops from my location that I've coming back from my location display and the destination location which the user tapped on and then I call solve route on the route task I pass in my parameters and again there's a completion block that gets called when that async operation finishes and it's got the result hopefully a route or an error if something went wrong I do some error handling if there's nothing wrong with the error I go into the result get the first route I get the geometry of that first route I added as a graphic to the graphic overlay and I set my viewpoint to that route and then I can also print all the directions in the console I'm not going to display them in the app so let me go ahead and run this I get prompted that my look the app wants to use my location which is all right there's my location on the map you're going to go ahead pan away find a feature tap on it and then hit that accessory button to perform a route and there's my route it's displayed as the line on the map you'll see that the lines actually going underneath the search bar because it's going to the edge of the map you might have UI like this there's a pro tip where there are things overlaying your map and you want to make sure that when you set view points or you zoom to areas they're centered in the unobscured portion of the map so for that we have a property called content insect which you can set up as in this case I'll use I'll give it a top edge that is just below the width of the search bar and so that way now whenever I call set viewpoint the map view is going to make sure that that viewpoint is adjusted in the unobscured portion below the search bar and there you go it's just right there instead of at the top of the map even this dough is too close to the edges of the map for me so what we have is we have an overload for the set viewpoint method that can also take a padding in this case I'll give it a padding of 25 points and so it'll give some breathing room around that that area of interest that we want to zoom to and it won't go from edge to edge and there you could see there's a little bit more space on either side of the road so very quickly using locator tasks the route task and a call-out we've been able to build this type of an app so we looked at how we work with maps and map views how we work with storyboards and add views to that how we use the locator tasks graphics overlays I talked about the task pattern like the geocode method which is a async there's a callback block that's invoked with the results in errors you look at the errors first make sure everything went okay and then process the results there's more information about tasks and jobs that I won't get into right now everything that we've seen so far has been small one short operations that come back quickly but there might be some operations that are multiple stages such as downloading a map those are longer runs and for those cases we have jobs which allow you to inspect the progress of that job on the server serialize it to disk so that if the user quits the app and comes back you can get the results of the job when they're finished on the server when your user was not working with the job and we have a lot of examples that do that in code on the website something to think about is threading we have a pattern that we follow which we use to make sure we call back on a certain thread that you expect basically if you invoke the operation from the main thread we'll call back on the main thread because we're expecting you probably want to update the UI but if you called that operation from a background thread then we will call you back on any background thread as we assume you don't want things to happen on the main thread if in that callback you now want to do some UI work you'll have to make sure you dispatch back to the main thread otherwise your UI will not update there's a blog post we wrote about how threads work with the ArcGIS runtime SDK have a link to that it's in that geo net community space my colleague Nick Furness did a really good job of explaining that and I recommend you give that a read it's really simple rules that we follow and we think those rules will actually fit in fine with your development workflows we looked at how we added some feature layer to the map we did interaction with it by tapping on a feature showing a call-out and we did some routing and did some viewpoint adjustment using content inserts and padding when you're working with location display many times you want to simulate location Xcode provides a great way for you to set a custom location but many times you want to simulate along a specific path the SDK provides a couple of data sources for you that can simulate locations based on information in a GPX file that you might have or a route geometry polyline that you might have created and there are a number of auto pan modes that we provide that automatically recenter the map as the location changes finally I just want to point out some more resources we have for you tool kits are a great way those are sort of like the widgets that somebody was asking about before we provide their really high level UI components you can add to your app and we have things for compass and scale bar and legend and they really simplify your app development and they're open source you can get them on github and you can then modify them to match your apps look and feel or add a little bit more to it depending on what you want to do and if you just want a full-blown app that you can start customizing then look at our open source or example apps you saw a couple of them in the plenary this morning the data collection app and the DSA app we have a couple of other iOS apps like map book and maps and we provide all the source code for github and they really target a specific workflow that you're trying to build into your apps so check those out on developers Giorgio's comm and finally there's a lot more sessions on runtime the deep dive into specific areas that I haven't gotten into in this session I encourage you to check those out we have a release that is coming out in just a few days hopefully by the end of the month we call it update five it'll have a lot of new features and we'll talk a little bit more about those features in the road ahead so make sure you check that out finally I want to give you just some heads up on deprecations we've decided that will be deprecating the mac OS sdk for runtime primarily because of two reasons a we don't see a lot of adoption of it in the enterprise space how many of you build apps for the Mac o are you sure one guy all right he is but 105 will be the last release of the Mac OS SDK and then after that we look into something that Apple's announce where they'll allow iOS programmers to bring their iOS apps to the Mac we hope to sort of build on top of that and allow those workflows so we'll see where Apple takes that and we'll be following closely behind and then Apple's deprecated OpenGL last year all of our graphics is built on OpenGL OpenGL years but we have been working on trying to move it to metal so that just got more momentum after Apple's announces application so hopefully enough future version of runtime not too far away you will see a version of the SDK that does all its rendering using metal and you won't be impacted by the deprecations so that's all I had for you thanks for your time and you have the events app please give us feedback on how you like the session what you want to see next year we take your feedback really seriously and have a good conference [Applause]
Info
Channel: Esri Events
Views: 1,694
Rating: 5 out of 5
Keywords: Esri, ArcGIS, GIS, Esri Events, Geographic Information System
Id: eKckCWx1K_w
Channel Id: undefined
Length: 62min 17sec (3737 seconds)
Published: Wed Apr 03 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.