Skip to content

SEARCH:KEY_ENTERED does not work #12

@firmanhidayat

Description

@firmanhidayat

// Setup Angular Broadcast event for when an object enters our query
var geoQueryCallback = query.on("key_entered", "SEARCH:KEY_ENTERED");

// Listen for Angular Broadcast
$scope.$on("SEARCH:KEY_ENTERED", function (event, key, location, distance) {
    // Do something interesting with object
    $scope.searchResults.push({key: key, location: location, distance: distance});

    // Cancel the query if the distance is > 5 km
    if(distance > 5) {
        geoQueryCallback.cancel();
    }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions