       osmId:"=osmId",
       hoveredBoundary:"="
       stateBoundary:"="
+      wardBoundary:"="
       districtBoundary:"="
       selectedLayer:"="
     }

              highlightFeature(scope.layerMap[id])


    loadState = (osmId, highlightOsmIds) ->

      if not osmId
        return

      else
        @$apply fn

    # when state, district or ward change
    scope.$watchCollection ->
      [scope.stateBoundary, scope.districtBoundary, scope.wardBoundary]
    , (current, previous) ->

      scope.safeApply ->
        if current
          if scope.wardBoundary
            loadAdminLevel(scope.districtBoundary.osm_id, [scope.wardBoundary.osm_id])
          else if scope.districtBoundary
            loadAdminLevel(scope.stateBoundary.osm_id, [scope.districtBoundary.osm_id])
          else if scope.stateBoundary
            resetStates([scope.stateBoundary.osm_id])
          else
