I am looking for two things in Gmap in combination with Location (cck) and views.

I created a gmap view with exposed filters.
After i enter the URL of the gmap page view, the view gives me all the results directly after opening the view.

Is there a way to create the view so that the Gmap is displayed without any results from the start?
Results should then show up, only after clicking the apply or search button.

Another thing i like to achief is to display the Gmap even when there are any results at all.
Right now the 'empty text' is displayed when there are no results.

Thanks.

Comments

morbiD’s picture

I need to achieve this as well.

Putting a default GMap macro in the "Empty text" field seems to work fine for basic page views.

However, I'm currently trying to implement a block view with AJAX enabled and doing the above doesn't work properly at all. (Hardly surprising given the problems already described in #315236: GMap View, Exposed Filters and the error "Javascript is required to view this map" upon AJAX update).

Anyone else got any ideas for my setup?

held69’s picture

@morbiD

How do i place the default macro proper in the empty field text?
Should this be under full/filtered html or php and should there be any html or php combined with it.

Just pasting [gmap |id=usermap|center=40,0|zoom=3|width=100%|height=400px] didn't give me the right result.

Thanks

morbiD’s picture

You have to have an input format set up with the "GMap macro expander" filter turned on, as described in the README.txt. You can then select that input format for the empty text and your pasted macro will work.

Personally, I created a new input format called "GMaps Only" but say you've turned the filter on in the "Full HTML" format, you should be able to just use Full HTML for your empty text.

Anonymous’s picture

@morbid: I have the Javascript error now, too. Have you worked around this?

morbiD’s picture

As far as I remember, the AJAX problems were fixed in issue #315236 linked above, so I'm not sure why you would be getting errors. Did you install the dev version of GMap? The fixes were committed to dev in November 2010 but the current release version was released earlier than that in July 2010.

Anonymous’s picture

Status: Active » Fixed

I fixed this in an unexpected way. The custom input format I set up for the gmap macro included "gmap macros" and "HTML". Removing the HTML solved it. The custom input format is now "gmap macros"-only. I don't really understand why this made a difference but it did.

Status: Fixed » Closed (fixed)

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