Download Free Demos

Map View

The Map view presents a list of upcoming events and Google Maps to show or edit the event's location or to set the location for new events.

google map view

By default, the left list of the view displays events beginning from the current date. To change such behavior, use the start_date, end_date properties.

Initialization

To initialize the Map view and add it to the scheduler, use the code below:

public ActionResult Index() {
    var sched = new DHXScheduler(this);
    ...
    var map = new MapView{
       ApiKey = "AIzaSyBjsINSH5x39Ks6c0_CoS1yr1Mb3cB3cVo"
    }; // initializes the view
 
    sched.Views.Add(map); // adds the view to the scheduler
 
    return View(sched);
}

Google Maps APIs require an API key. See the details.

Properties

To configure the Map view, make use of the properties below:

  • Label - (string) the text label. The default value - 'Map'
  • ApiKey - (string) Google Maps API key
  • ClientId - (string) Google Maps client ID
  • Signature - (string) Google Maps digital signature
  • MarkerGeoFail - (string) sets the text for the notice window that appears in case of unsuccessful geolocation response
  • MarkerGeoSuccess - (string) sets the text for the notice window that appears in case of successful geolocation response
  • Name - (string) the name of the view. The property is read-only. By default - 'map'
  • StartDate - (DateTime) sets the date that the view will display events starting from. By default - the current date
  • EndDate - (DateTime) sets the end date until which the view will display events
  • TabClass - (string) the name of the CSS class that will be applied to the tab
  • TabPosition - (integer) the right offset of the view tab in the tabbar. By default, tabs go right-to-left in the order of addition to the scheduler
  • TabStyle - (string) the style that will be applied to the tab
  • TabWidth - (integer) the width of the tab
  • ViewType - (string) the type of the view. The property is read-only

Details

Beware, to be correctly rendered on the map view data must contain a number of additional properties. The final list of mandatory properties (that data should have) looks as in:

  • start_date- (DateTime or string) the date when the event is scheduled to begin. The default format - "%m/%d/%Y %H:%i"
  • end_date - (DateTime or string) the date when the event is scheduled to be completed. The default format - "%m/%d/%Y %H:%i"
  • text - (string) the event text
  • location - (string) the location of an event
  • lat - (float) the latitude of the event location
  • lng - (float) the longitude of the event location

Was this article helpful?

Yes No