 	func updatePrimitives<T:GeoNode>(for node: T, with subRegions: Set<T.SubType>)
 		where T.SubType : GeoPlaceContainer {
 		if AppDelegate.sharedUserState.placeVisited(node) {
-			regionPrimitives.removeValue(forKey: node.hashValue)
-
-			let hashedPrimitives = subRegions.map { ($0.hashValue, $0.poiRenderPlanes()) }
-			regionPrimitives.merge(hashedPrimitives, uniquingKeysWith: { (l, r) in l + r })
+			let removedRegionsHash = node.hashValue
+			regionPrimitives = regionPrimitives.filter { $0.ownerHash != removedRegionsHash }
+			let subregionPrimitives = subRegions.flatMap { $0.poiRenderPlanes() }
+			regionPrimitives.append(contentsOf: subregionPrimitives)
 		}
 	}
 	
 	func updateZoomThreshold(viewZoom: Float) {
-		let previousPois = Set(regionPrimitives.values.flatMap { $0.filter { Float($0.rank) <= rankThreshold } })
-		let visiblePois = Set(regionPrimitives.values.flatMap { $0.filter { Float($0.rank) <= viewZoom } })
+		let previousPois = Set(regionPrimitives.filter { Float($0.rank) <= rankThreshold })
+		let visiblePois = Set(regionPrimitives.filter { Float($0.rank) <= viewZoom })
 
 		let A = previousPois.subtracting(visiblePois)	// Culled this frame
 		let B = visiblePois.subtracting(previousPois) // Shown this frame

		let primitive = IndexedRenderPrimitive(vertices: vertices,
																						indices: indices, scalarAttribs: scalars,
																						color: rank.hashColor.tuple(),
																						ownerHash: container.hashValue,
																						debugName: "\(container.name) - poi plane @ \(rank)")
		return PoiPlane(primitive: primitive, rank: rank, toggleTime: Date())
	}
}
	
extension GeoRegion {
	func poiRenderPlanes() -> [PoiPlane] {
		return sortPlacesIntoPoiPlanes(places, in: self);

import OpenGLES
import GLKit

struct PoiPlane: Hashable {
	let primitive: IndexedRenderPrimitive
	let rank: Int
	var ownerHash: Int { return primitive.ownerHash }
	
	func hash(into hasher: inout Hasher) {
		hasher.combine(primitive.ownerHash)
		hasher.combine(rank)
	}
	
	static func == (lhs: PoiPlane, rhs: PoiPlane) -> Bool {
		return lhs.hashValue == rhs.hashValue
	}
}

class PoiRenderer {
	var regionPrimitives : [PoiPlane]
	let poiProgram: GLuint
	let poiUniforms : (modelViewMatrix: GLint, color: GLint, rankThreshold: GLint, progress: GLint)
	var rankThreshold: Float = 1.0
