Forum: Premium Settings

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support related to the Premium Settings premium extension please open a new premium support ticket.

[Resolved]Prevent non-members to see exact address location on map

Forums Premium Settings Prevent non-members to see exact address location on map


Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • #50118
    Chris Post

    We’re working on an Events website in which we have installed your plugin along with the Premium Settings add-on. We have integrated the Events Manager plugin with GeoMyWP so that the latter displays user-generated Events in the GeoMyWP Map. However, we would like to implement a functionality in which only registered members can see the exact address location of these Events, and non-members would still see the map but without having access to the Event exact location.

    Right now are considering two ways of doing this, and we would like to know which one would be easier to implement with GeoMyWP:

    1. Instead of displaying a Map Icon (i.e. Pin) to non-members, they will see a “Radius” circle which will cover a certain distance surrounding the Event location, but without showing the actual address.

    2. Having a “Max Zoom” level for non-members, so that they will be able to look through the map, but they won’t be able to zoom close enough in order to see the actual street names, etc (Maybe having a “State” level zoom limit).

    So, in your opinion, which would should be easier to implement with our current setup? Do you have any add-on that could help us with either of these options? If not, how difficult would it be to implement either of those with custom coding? (I understand we would probably have to mess with the Google Maps API to do this).

    Any additional advice or observation you can give us will be greatly appreciated.


    Chris Post

    So, we were going through the GeoMyWP code and we discovered there’s a filter to add custom GoogleMap options, which makes everything so much easier. Here’s our solution, in case anyone else wants to implement a similar feature:


    Hi Chris,
    Indeed, your solution is the one I would have recommended as well since it is an easy fix as you can see. Thank you for posting the solution ( FYI, wrapping the code with PRE tags will display it properly ) .

    Having a radius circle instead of a marker is on my todo list since I like this solution as well ( might be a bit more of an elegant solution ). However, I will most likely add it only in the next major update of GEO my WP and all of the add-ons.

    Chris Homan

    It doesn’t seem to work on my maps, logged out users can still zoom in to 20. I just added the function to functions.php as was – or do I need to alter it in some way to make it specific to my forms?

    Chris Post

    No, that function by itself won’t allow you to do that. You would need something like this:

    Instead of “read” you can put any other capability or role you want

    Chris Homan

    Hi Chris,

    Sorry, I did a bit more than the original code. This is what I used and it doesn’t seem to do much…

    I tried yours as well with the same result 🙁

    I must be missing something…


    @Chris Homan,
    Look like you code is missing a closing bracket before the return $mapElement; or remove the opening bracket of the if statement.

    However, it might not be the issue.

    Are you trying to apply this script to a Global Map or a normal search form?

    Chris Homan

    I’m trying to set it as a generic setting – it should apply to all maps and forms.


    The script should work for normal search forms. However, it will not work for global maps right now since Global Maps uses its own “mapping system” which doesn’t have such filter. The Global Maps mapping system will be updated with Geo my WP 3.0 when its ready.

    At the moment try the script below for your global maps. Replace the value 3 in gmwMapOptions[3] with your form ID:


    This topic marked “Resolved” due to inactivity. If you wish to reply to this topic please change its status to “Not resolved”  before replying.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.