Forum: Gravity Geolocation

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 Gravity Geolocation premium extension please open a new premium support ticket.

[Resolved]Zoom map on marker position

Home Forums Gravity Geolocation Zoom map on marker position

This topic contains 8 replies, has 2 voices, and was last updated by  Eyal Fitoussi 3 years, 7 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #51589

    redhill
    Participant

    Hi,
    I am using the latest Gravity Forms, and GEOMYWP ( beta-18 ) and its all going great.

    I am using a map of Australia zoomed to 3, so that when a visitor first views the map, you can see the whole country.

    But I would like the map to Zoom into, say level 10, when a user enters an address.

    Is this possible?

    Cheers

    #51598

    Eyal Fitoussi
    Keymaster

    Hello Regan and thank you for the purchase.

    I am using a map of Australia zoomed to 3, so that when a visitor first views the map, you can see the whole country.

    But I would like the map to Zoom into, say level 10, when a user enters an address.

    Is this possible?

    Unfortunately, it is not possible out of the box. You could probably achieve that by editing a core file of the plugin. I might be able to direct to to the right direction if you are comfortable doing that.

    #51628

    redhill
    Participant

    Hi Mate,

    Hit me with your coding awesomeness 🙂

    #51688

    redhill
    Participant

    LOL, I mean, I would love to have a go at this if you can help me with it 🙂

    #51692

    Eyal Fitoussi
    Keymaster

    Hi Regan,
    I apologize for missing out your previous really. I am going to look into the custom solution and will get back to you.

    #51696

    redhill
    Participant

    Cheers for that.

    Perhaps this may be a feature request?

    #51700

    Eyal Fitoussi
    Keymaster

    OK.
    There are two steps you should do:

    1) Open the file gravityforms-geolocation/assets/js/gfgeo.min.js and just below line 962 which should be

    add the script

    This script is like a hook that will allow you to add custom functions when the map updates. Now, because you are editing the plugin’s core file this script would usually be removed when updating the plugin. However, I already added this hook to the core plugin so the next time you update the plugin you will not have to do it again.

    2) In the functions.php file of your theme or child theme add the script from this page below which is the custom function that will set the zoom level to 10 every-time the map updates.

    Let me know if that works.

    Perhaps this may be a feature request?

    I am not sure. Sometimes a better solution would be to add a hook ( as I did in here ) so it allows you to not only add the feature you mentioned above with a simple custom function but also to add other features you might need in the future.

    I hope that makes sense.

    #51827

    Eyal Fitoussi
    Keymaster

    HI Frank,
    Just checking if the above solution worked for you.

    #51949

    Eyal Fitoussi
    Keymaster

    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 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.