Skip to content

Instantly share code, notes, and snippets.

View nixta's full-sized avatar

Nicholas Furness nixta

View GitHub Profile
@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;
//
// AGSLocator+suggestionSwizzle.swift
// SuggestTest
//
// Created by Nicholas Furness on 8/17/16.
// Copyright © 2016 Esri. All rights reserved.
//
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);
}
@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 / AGSSingleFingerZoomGestureRecognizer.swift
Last active March 23, 2021 13:17
A Google-Maps like single-finger zoom gesture for the ArcGIS Runtime SDK for iOS. Awesome idea, Google Maps team! 👏👏👏
//
// AGSSingleFingerZoomGestureRecognizer.swift
//
// Created by Nicholas Furness on 6/17/16.
// Copyright © 2016 Esri. All rights reserved.
//
import Foundation
import ArcGIS
@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 / index.html
Last active November 27, 2015 21:57
Example Webmap
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href=
"http://js.arcgis.com/3.14/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href=
"https://rawgit.com/benheb/legend/master/legend.css">
@nixta
nixta / webmap.json
Created November 19, 2015 00:01
DC Parks
{
"item": {
"title": "New Map",
"snippet": "DC Parks",
"extent": [
[
-151.31757812495937,
-12.432019913106776
],
[
@nixta
nixta / GetMapDetails.js
Last active August 29, 2015 14:10
Bookmarklets for the ArcGIS Online viewer
if (typeof arcgisonline !== 'undefined' && arcgisonline.map.main.map !== null) {
var m = arcgisonline.map.main.map,
c = m.extent.getCenter();
alert('Scale = 1 : ' + m.getScale() +
'\nZoom Level = ' + m.getZoom() +
'\nCenter = ' + c.x + ', ' + c.y +
'\nLat,Lon = ' + c.getLatitude() + ', ' + c.getLongitude());
} else {
alert('Use this bookmark while viewing a map at ArcGIS.com!');
}
@nixta
nixta / .htaccess
Last active March 19, 2024 22:52
.htaccess to add CORS to your website
# Add these three lines to CORSify your server for everyone.
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"