Skip to content

Commit

Permalink
Deprecate MapKeyTransform.apply[K: SpatialComponent]: K => Extent
Browse files Browse the repository at this point in the history
  • Loading branch information
fosskers authored and echeipesh committed Oct 6, 2017
1 parent 44ee483 commit 8ceeef0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ class MapKeyTransform(val extent: Extent, val layoutCols: Int, val layoutRows: I
e1.expandToInclude(e2)
}

/** Fetch the [[SpatialKey]] that corresponds to some coordinates in some CRS on the Earth. */
def pointToKey(p: Point): SpatialKey = apply(p)

def apply(p: Point): SpatialKey = apply(p.x, p.y)

/** Fetch the [[SpatialKey]] that corresponds to some coordinates in some CRS on the Earth. */
def pointCoordsToKey(x: Double, y: Double): SpatialKey = apply(x, y)
def pointToKey(x: Double, y: Double): SpatialKey = apply(x, y)

def apply(x: Double, y: Double): SpatialKey = {
val tcol =
Expand All @@ -103,8 +104,7 @@ class MapKeyTransform(val extent: Extent, val layoutCols: Int, val layoutRows: I
(tcol.floor.toInt, trow.floor.toInt)
}

def keyLikeToExtent[K: SpatialComponent](key: K): Extent = apply(key)

@deprecated("Use this instead: MapKeyTransform.keyToExtent(key.getComponent[SpatialKey])", "1.2")
def apply[K: SpatialComponent](key: K): Extent = apply(key.getComponent[SpatialKey])

def keyToExtent(key: SpatialKey): Extent = apply(key)
Expand Down

0 comments on commit 8ceeef0

Please sign in to comment.