Santa

Let’s Talk

We would love to hear from you. Want to know more about
our services or have any questions? Say Hi!

Sitecore : Habitat MapField Issue

December 21, 2018
Sitecore : Habitat MapField Issue
Mitesh Patel
Mitesh Patel
Technical Head
sitecore-habitat-mapfield-issue
sitecore-habitat-mapfield-issue-1

Sitecore Habitat provides MapField to setup location related information. From July 2018 Google has deprecated keyless usage as well as their pricing model. Below the actual error when configuring MapField in Sitecore Habitat. Due to this issue Forward and Reverse Geocoding and Google Map is not displaying in Sitecore.

sitecore-habitat-mapfield-issue-2
Google Cloud Platform Portal Check

Before applying the solution. Please check your Google Cloud Platform Portal (https://console.cloud.google.com/google/maps-apis/overview) to check enabled applications under Google API. Please refer below image –

sitecore-habitat-mapfield-issue-3
Steps to enable MapField in Sitecore
  1. Modify XML file

    Path: src\Feature\Maps\code\Sitecore\Shell\Applications\Content Manager\Dialogs\Maps

    File Name: MapLocationPickerDialog.xml

    Change: Removed “Key=Google API Key” and appended Querystring with Google API Key value. Please refer below image –

    sitecore-habitat-mapfield-issue-4
  2. Modify Javascript file

    Path: src\Feature\Maps\code\Scripts\Maps

    File Name: map.js

    Change: Updated Google API Key in data-key attribute. Please refer below image –

    sitecore-habitat-mapfield-issue-5
  3. Modify CS file

    Path: src\Feature\Maps\code\Sitecore\Shell\Applications\ContentEditor\FieldTypes

    File Name: MAPField.cs

    Change: Add Google API key in GetMapImageUrl function. Please refer below image –

    sitecore-habitat-mapfield-issue-6

    Hope this is helpful. Happy Coding.

If you still facing any issue regarding the sitecore habitat mapfield, connect with sitecore development team or just simply Mail us at info@addact.net.


YOU MAY ALSO LIKE