Unlike for the Google MAP API, where no API key would really be needed to request display of a Map, Baidu Maps needs a Baidu Map API Key to be able to request inclusion of the Baidu Map API JS libraries.
Currently, if a wrong key or no key is configured, the display formatter would fail to display the Baidu Map.

Maybe a proper way to solve this issue would be to check if there is no valid Baidu Map API Key configured, in which case a simple sentence could be displayed instead of the Map to let users know of the problem. Otherwise, the map could be displayed correctly as expected.

Please let me know if you would have any questions, objections, comments, suggestions, recommendations or concerns on any aspects of feature request, I would be glad to provide more information or explain in more details.

Any questions, feedback, testing, changes, ideas or recommendations would be highly appreciated.
Thanks to all in advance.

Comments

xiukun.zhou’s picture

Title: Hide Baidu Map and display message if the BM API Key not configured » Hide Baidu Map and display message if the BM API Key is not configured
Status: Active » Fixed

Quick follow-up on this bug report:

Added an if statement at the top of the display formatter view function to check whether a Baidu Map API Key is configured.
If no valid key is found, then the entire formatter is skipped and a simple sentence is displayed instead of the Map:
Unable to display Baidu Map: no value found for the API Key.
Otherwise, the Map is displayed as expected.

I went ahead and committed the changes against the 7.x-1.x branch at b1ccc54.

I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this issue or related commit b1ccc54 (we would surely be happy to hear your feedback).

Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on the commits or this bug report in general, I would be glad to provide more information or explain in more details.

Thanks in advance to everyone for your testing, reviews, feedback and comments on this issue.
Cheers!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.