onLocationError

fires when the event location can't be found on the map (the Map view only)

void onLocationError(string id);
idstringthe event's id

Example

//With such a handler each time the location can be identified, scheduler will apply
//the coordinates of the Greenwich Royal Observatory to the event
 
scheduler.attachEvent("onLocationError", function (id){
    alert("Location can't be found");
    return google.maps.LatLng(51.477840, -0.001492); 
    //the coordinates of the Greenwich Royal Observatory
});

Details

The event will fire only with the map_resolve_event_location configuration property enabled.


How does the event work?

  • If an event in the database doesn't have the 'lat' and 'lng' values, the scheduler will make an attempt to resolve them based on the 'event_location' value, while loading events to the scheduler. If the specified location will be identified, the corresponding coordinates will be saved in the DB. If not, the scheduler will fire the onLocationError event.
  • Enabling the the map_resolve_event_location configuration property is useful for migration, but not for production stage.
  • The event will affect only the events which are loaded from DB.

The event can be used to provide custom reaction to the situation, when the scheduler tries to load an event with an invalid or empty location.
For example, it's possible to return a google.maps.LatLng object with geographical coordinates that will be applied to the event in case of error.

Back to top