Jump to Content

Objective HTML

Google Maps for ExpressionEngine

The complete geolocation and mapping toolkit

Accessing the Geocoder

It's possible to send an HTTP request to the geocoder directly from a template by using the exp:gmap:geocode method. This method uses the cURL Library to send a synchronous request. If you need asynchronous functionality you should use JavaScript. Also be mindful of the API Usage Limit if you use this method.

If the cURL Library library isn't installed on your server, this method will not work.

    {exp:gmap:geocode query="Indiana"}
  • {formatted_address}

    Location Type: {location_type}
    Lat: {latitude}, Lng: {longitude}

    {if count == 1}

    Address Components

    • Short Name: {short_name}
      Long Name: {long_name}
      Types: {types}
    • {/address_components}
  • {/exp:gmap:geocode}

Sample Response

  • {formatted_address}

    Location Type: {location_type}
    Lat: {latitude}, Lng: {longitude}