Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks for responding.

    I realise the code I posted will just give me an HTML attribute that I can (if I knew what I was doing!) reference in the JS map creating code.

    I think I’ve confused you by mentioning two isues, so let’s just concentrate on the original topic which I still can’t get working.

    In relation to your original suggestion above (2nd post in response to the OP) – from what I understand your suggestion is to use the example JS code from the ACF website (which works in its own right if zoom is left as a number in the vars) substituting the
    `var args = {
    zoom : 16`
    for your
    `var args = {
    zoom : $location [ ‘zoom’ ]`

    This is what gives me the error I’m finding through firebug. If as you say, this should be PHP, how do I implement your original answer to the original question using the ACF example you suggested?

    Sorry if I’m not making sense!

    I’ve been trying to get this to work for days on and off, and for the life of me can’t.

    Using your suggestion above, I get an error in firebug:
    ReferenceError: $location is not defined

    In addition to this, I’ve also been trying to get two maps with two levels of zoom on the page, so something like this would be ideal:

    $location = get_field('location');
    $location2 = get_field('location2');
    if(!empty($location)):
    ?>
    <div class="acf-map">
        <div class="marker" data-zoom="<?php echo $location['zoom']; ?> data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"></div>
    </div>
    
    <div class="acf-map">
        <div class="marker" data-zoom="<?php echo $location2['zoom']; ?> data-lat="<?php echo $locatio2n['lat']; ?>" data-lng="<?php echo $location2['lng']; ?>"></div>
    </div>

    Any good ideas?

Viewing 2 replies - 1 through 2 (of 2 total)