Skip to content

Instantly share code, notes, and snippets.

View nixta's full-sized avatar

Nicholas Furness nixta

View GitHub Profile
@nixta
nixta / 1_TidiedCode.m
Last active April 22, 2016 14:34
Couple of suggestions for code
- (void)clickedonPoint {
self.m_mapView.touchDelegate = self;
self.m_sketchLayer.geometry = [[AGSMutablePoint alloc] initWithSpatialReference:self.m_mapView.spatialReference];
// Not sure why you have a sketchLayer here.
// However, if you do have one, you need to set the mapView's touchDelegate to the sketch layer.
// See https://developers.arcgis.com/ios/swift/guide/sketch-layer.htm#GUID-4CF8925A-B8B9-4656-AE3D-51DD126234CA
}
-(void)mapView:(AGSMapView *)mapView didClickAtPoint:(CGPoint)screen mapPoint:(AGSPoint *)mappoint features:(NSDictionary *)features {
@nixta
nixta / WalkTimeViewController.swift
Last active July 11, 2016 20:07
Sample View Controller to do Walk Directions in the 10.2.5 ArcGIS Runtime SDK for iOS
//
// ViewController.swift
// WalkTimeTest-Swift
//
// Created by Nicholas Furness on 7/11/16.
// Copyright © 2016 Esri. All rights reserved.
//
import UIKit
import ArcGIS
@nixta
nixta / safer-ui-show-hide-patch.js
Created August 9, 2016 19:41
Example of how to patch a JS API dojo class with additional functionality.
require([
"esri/views/ui/UI"
], function(UI) {
var extension = {
hide: function() {
_setUIVisible(this, false);
},
show: function() {
_setUIVisible(this, true);
}
//
// AGSLocator+suggestionSwizzle.swift
// SuggestTest
//
// Created by Nicholas Furness on 8/17/16.
// Copyright © 2016 Esri. All rights reserved.
//
import ArcGIS
@nixta
nixta / ViewController.m
Created September 6, 2016 21:59
Simulating GPS with the ArcGIS Runtime SDK for iOS
#import "ViewController.h"
#import <ArcGIS/ArcGIS.h>
#define kSimulatedMetersPerSecond 2
@interface ViewController () <AGSRouteTaskDelegate>
@property (nonatomic, strong) AGSRouteTaskParameters *defaultParams;
@property (nonatomic, strong) AGSRouteTask *routeTask;
@property (weak, nonatomic) IBOutlet AGSMapView *mapView;
@nixta
nixta / ArcGISMapDeets.html
Last active April 20, 2017 13:17
A bookmark to give you info on your current view of a map at ArcGIS.com.
<a href='javascript:void((function(){var m=false; if (typeof esri !== "undefined" && typeof esri.arcgisonline !== "undefined") {if (esri.arcgisonline.map.main.map !== null) {m=true;}}; if (m) {var a=esri.arcgisonline.map.main.map; var l=a.__LOD, c=a.extent.getCenter(); alert("Scale: " + l.scale + "\nLevel: " + l.level + "\nCenter: " + c.x + "," + c.y + "\nLat,Lon: " + c.getLatitude() + "," + c.getLongitude());} else {alert("Use this bookmark while viewing a map at ArcGIS.com!");}})());'>ArcGIS Map Deets</a>
@nixta
nixta / AGSGraphicsOverlay+Name.swift
Created May 5, 2017 20:03
Name an AGSGraphicsOverlay
extension AGSGraphicsOverlay {
fileprivate struct AssociatedKeys {
static var referenceNameKey = "geodev_referenceName"
}
var referenceName:String? {
get {
return objc_getAssociatedObject(self, &AssociatedKeys.referenceNameKey) as? String
}
set {
@nixta
nixta / animatedotwithwebscene.js
Created May 14, 2017 01:05
Animate a dot in a graphics layer having loaded a web scene.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Load a basic web scene - 4.3</title>
<link rel="stylesheet" href="https://js.arcgis.com/4.3/esri/css/main.css">
<script src="https://js.arcgis.com/4.3/"></script>
@nixta
nixta / geofencing.js
Last active May 14, 2017 13:21
A PubNub Geofencing Block (See structure of sample services below at lines 16&17).
export default (request) => {
let query = require('codec/query_string');
// return if the block does not have anything to analyze
if (!query) {
return request.ok();
}
// Require console to print debug information
let console = require('console');
@nixta
nixta / ViewController.swift
Last active November 10, 2017 18:38
How to drag a graphic with ArcGIS Runtime SDK for iOS
//
// ViewController.swift
// TestDrag
//
// Created by Nicholas Furness on 11/10/17.
// Copyright © 2017 Esri. All rights reserved.
//
import ArcGIS