Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Merge pull request #177 from Esri/SmallChanges
Browse files Browse the repository at this point in the history
Small changes
  • Loading branch information
dg0yal committed Jun 3, 2016
2 parents ce34f9f + 5d46485 commit 2a91f82
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "stopA36.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "stopA72.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "stopA108.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "StopB36.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "StopB72.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "StopB108.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15B30a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="hxJ-u5-xSg">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15F31a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="hxJ-u5-xSg">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Find Route View Controller-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,22 @@ class FindRouteViewController: UIViewController {
self.stop1Geometry = AGSPoint(x: -13041171.537945, y: 3860988.271378, spatialReference: AGSSpatialReference(WKID: 3857))
self.stop2Geometry = AGSPoint(x: -13041693.562570, y: 3856006.859684, spatialReference: AGSSpatialReference(WKID: 3857))

let startStopGraphic = AGSGraphic(geometry: self.stop1Geometry, symbol: self.stopSymbol("Origin", textColor: UIColor.blueColor()))
let endStopGraphic = AGSGraphic(geometry: self.stop2Geometry, symbol: self.stopSymbol("Destination", textColor: UIColor.redColor()))
//picture marker symbols for the graphics
let startImage = UIImage(named: "StopA")!
let startSymbol = AGSPictureMarkerSymbol(image: startImage)
startSymbol.offsetY = startImage.size.height/2

let endImage = UIImage(named: "StopB")!
let endSymbol = AGSPictureMarkerSymbol(image: UIImage(named: "StopB")!)
endSymbol.offsetY = endImage.size.height/2

//create graphics for start and end
let startStopGraphic = AGSGraphic(geometry: self.stop1Geometry, symbol: startSymbol)
let endStopGraphic = AGSGraphic(geometry: self.stop2Geometry, symbol: endSymbol)

self.stopGraphicsOverlay.graphics.addObjectsFromArray([startStopGraphic, endStopGraphic])
}

//method provides a text symbol for stop with specified parameters
func stopSymbol(stopName:String, textColor:UIColor) -> AGSTextSymbol {
return AGSTextSymbol(text: stopName, color: textColor, size: 20, horizontalAlignment: .Center, verticalAlignment: .Middle)
}

//method provides a line symbol for the route graphic
func routeSymbol() -> AGSSimpleLineSymbol {
let symbol = AGSSimpleLineSymbol(style: .Solid, color: UIColor.yellowColor(), width: 5)
Expand Down Expand Up @@ -134,9 +139,9 @@ class FindRouteViewController: UIViewController {

//set the stops
let stop1 = AGSStop(point: self.stop1Geometry)
stop1.name = "Origin"
stop1.name = "A"
let stop2 = AGSStop(point: self.stop2Geometry)
stop2.name = "Destination"
stop2.name = "B"
self.routeParameters.setStops([stop1, stop2])

self.routeTask.solveRouteWithParameters(self.routeParameters) { (routeResult: AGSRouteResult?, error: NSError?) -> Void in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class FindAddressViewController: UIViewController, AGSMapViewTouchDelegate, UISe
let graphic = self?.graphicForPoint(results[0].displayLocation!, attributes: results[0].attributes)
self?.graphicsOverlay.graphics.addObject(graphic!)
//zoom to the extent of the graphic to highlight the result
self?.mapView.setViewpointGeometry(results[0].displayLocation!.extent, completion: nil)
self?.mapView.setViewpointGeometry(results[0].extent!, completion: nil)
}
else {
//provide feedback in case of failure
Expand Down

0 comments on commit 2a91f82

Please sign in to comment.