Google Maps Component

Overview

Google Maps Component Plugin provides support for displaying interactive maps, directions, and markers in a SAIL interface.

Pre-requisites: 

Key Features & Functionality
  • fn!googleMapsDisplayField
    • Displays a map centered on a specific latitude and longitude, with an optional pre-set list of custom markers. When a user clicks on a marker, the metadata is returned via a SaveInto.
    • Optionally allows the user to pan, use street view, and zoom.
  • fn!googleMapsDirectionsField
    • Displays map directions between 2 or more points.
    • It can automatically sort the waypoints to calculate the optimal route between the origin and destination. When the directions are computed, step-by-step directions, trip distance, and time are returned via a SaveInto.
    • Optionally displays current traffic conditions as an overlay, and exposes route options such as avoiding highways, ferries, or tolls. Also able to display custom markers.
  • fn!googleMapsPinField
    • Displays a map where a user can drop and reposition a marker.
    • When no marker is selected a default map center position can be set and used.
Anonymous
Parents
  • Can someone paste the sample code for the googleMapsDisplayField() function. I am able to connect to the GMaps and also use the googleMapsDirectionsField() which is pretty straight forward. However, for googleMapsDisplayField. we need to pass the markers eg: 

    mapMarkers: {
    name: "MyPoint",
    content: "",
    lat: 25.7617,
    lng: 80.1918
    },

    Would appreciate if someone already tried this and working could help here.

    Thanks in adv.

    Regards,

    Raghu

  • You need to wrap your "MyPoint" marker in another set of curly brackets. That parameter is expecting a list of markers since there can be more than one on a single map.

    mapMarkers: {
      {
        name: "MyPoint",
        content: "",
        lat: 25.7617,
        lng: 80.1918
      }
    }

  • With a single marker, you will need to set the map center and zoom level. The content parameter is the text shown if you click on the marker. Does the following example work for you?

    fn!googleMapsDisplayField(
      googleMapsApiKey: "YOUR API KEY",
      mapCenter: {
        lat: 25.7617,
        lng: 80.1918
      },
      mapMarkers: {
        {
          name: "MyPoint",
          content: "",
          lat: 25.7617,
          lng: 80.1918
        }
      },
      zoomLevel: 10
    )

  • Thanks Andy.. But this still dint resolve. I thin i would need to pass some valid value in content as well.. 

Comment Children
  • With a single marker, you will need to set the map center and zoom level. The content parameter is the text shown if you click on the marker. Does the following example work for you?

    fn!googleMapsDisplayField(
      googleMapsApiKey: "YOUR API KEY",
      mapCenter: {
        lat: 25.7617,
        lng: 80.1918
      },
      mapMarkers: {
        {
          name: "MyPoint",
          content: "",
          lat: 25.7617,
          lng: 80.1918
        }
      },
      zoomLevel: 10
    )