• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

setting a default "no results found" for google map

Participant ,
Dec 27, 2012 Dec 27, 2012

Copy link to clipboard

Copied

A client is running the google maps search by proximity module. This works fine, except some selections don't generate a map, resulting in an empty div where the map should be (but isn't because there aren't any results.) So the client wanted to add "no results found" into the empty layer, which is easy enough with javascript. Except that now when there is a map, the js detects that that div is empty (because the map is added by javascript), and adds "no results found" until the map overwrites it.

And then I thought about maybe doing a callback on the google maps code except it doesn't even appear when there's no result. 

So my question is, how can I set a textual default for the map layer when this happens?

TOPICS
Web apps

Views

977

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Feb 19, 2013 Feb 19, 2013

Copy link to clipboard

Copied

LATEST

Hi Kenneth,

if (typeof google === 'object' && typeof google.maps === 'object') { your code }

This will detect if the maps module is rendered or not.

Kind Regards,

Alex.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines