Session on how to build a complete mobile-cloud solution using ArcGIS mobile APIs and an ArcGIS Online Subscription. How to monetize your solution too! By Allan Laframboise, Esri
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Building a mobile, cloud, checkin app in 75 minutes - zero to hero.
1. Building a Mobile, Cloud,
Check-in App in 75 Minutes
-
Zero to Hero
alaframboise@esri.com | @AL_Laframboise
dmartinez@esri.com | @ DMDevDude
Esri Developer Network
30. Mobile and Web
Apple iOS
Microsoft Windows
Phone 7
Google Android
Native or Web?
31. ArcGIS for JavaScript
ArcGIS for iOS
ArcGIS for Windows Phone
ArcGIS for Android
ArcGIS for Windows Silverlight
ArcGIS for Flex
resources.arcgis.com
35. Where in the world am I?
Mercator
Geographic - WGS 1984
-87.6,41.9
-9743828.3,5131825.1
36. Basemap Service
var basemapURL =
“http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer”;
dojo.require("esri.map");
map = new esri.Map("mapDiv", { wrapAround180: true, null });
map.SetSpatialReference({"wkid":102100});
var basemap = new
esri.layers.ArcGISTiledMapServiceLayer(basemapURL);
map.addLayer(basemap);
39. Input Coordinates
navigator.geolocation.getCurrentPosition(zoomToLocation, this.geolocationError);
function zoomToLocation(location) {
var centerPoint = esri.geometry.geographicToWebMercator(
new esri.geometry.Point(location.coords.longitude,
location.coords.latitude));
var symbol = new esri.symbol.PictureMarkerSymbol(
{"url":”images/BluePin1LargeB.png“,”width":28,"height":28} );
var graphic = new esri.Graphic(centerPoint, symbol);
geolocationLayer.graphics.add(graphic);
map.centerAndZoom(centerPoint, 16);
}
40. Geocode Service
var geocodeService = new
esri.tasks.Locator("http://tasks.arcgis.com/ArcGIS/rest/services/WorldLocator/GeocodeServer");
var address = { "SingleLine": address };
locator.outSpatialReference = map.spatialReference;
var params = {address: address, outFields: ["Loc_name"]}
geocodeService.addressToLocations(params, geoCodeResults);
Ext.each(candidates, function (candidate) {
if (candidate.score > 80) {
var geom = candidate.location;
var graphic = new esri.Graphic(geom,
symbol, null);
geoCodeLayer.graphics.add(graphic);
}
});
42. Geoprocessing Service
var geoProcessService = new esri.tasks.Geoprocessor(
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Network/ESRI_DriveTime_US/GPServer/C
reateDriveTimePolygons");
var driveTimes = “1 2 3”; // minutes
var featureSet = new esri.tasks.FeatureSet();
featureSet.features = features.push(geoCodeGraphic);
var params = {"Location":featureSet,"Times":driveTimes };
geoProcessService.execute(params, driveTimeResults, null);
function driveTimeResults(results,messages) {
var features = results[0].value.features;
for (var f = 0, fl = features.length; f < fl; f++) {
var feature = features[f];
if (f == 0) // minute 1
feature.setSymbol(polySymbolRed);
if (f ==1) // minute 2
…
driveTimeLayer.add(feature);
} );
}
50. Geometry Service - geofencing
Var geomService = new esri.tasks.GeometryService(
"http://tasks.arcgisonline.com /ArcGIS/rest/services/Geometry/GeometryServer");
var bufParams = new esri.tasks.BufferParameters();
bufParams.distances = [ 25 ];
bufParams.geometries = [ toPt ];
bufParams.outSpatialReference = new
esri.SpatialReference({"wkid":102100});
geomService.buffer(bufParams,
function (geometries) {
var geoFence = geometries[0];
var symbol = self.checkinToleranceSymbol;
var graphic = new esri.Graphic(geoFence, symbol);
geoFenceGraphicLayer.add(graphic) });
…
isPoint InFence = geoFence.contains(currentLocation); // local