• uklc2004

    (@uklc2004)


    Hello,

    I’m fairly new to wordpress. I have been using Event Organiser, and I have a couple of questions.

    1. Is there a way to zoom into a specific google map location via a text link, when there are multiple markers on the map? Here’s the site I’m working on – http://69.195.124.88/~livepriz/test/find-a-game/

    I want to be able to click a link on the left to zoom into the appropraite marker, without being redirected to another page.

    2. For the single event pages – Is there a way to add a shortcode to get the venue address?

    http://wordpress.org/extend/plugins/event-organiser/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter uklc2004

    (@uklc2004)

    O.k. I figured out the single page layout. So, just stuck on the first question.

    Plugin Author Stephen Harris

    (@stephenharris)

    Yup, there’s no shortcode for that, but you can provide a custom template to include that (and using the available functions).

    As for 1. It should be possible – not sure how though. First you need to listen for when the user clicks the link, and from that determine (by venue ID) which venue it was. You may do this by including the venue ID as a data attribute.

    Then find the venue on the map and zoom into it.

    Now the venues are stored in EOAjax.map.location javascript variable, unfortunately that only stores latitude/longtitude and tooltip content. In later versions I’ll probably add the venue ID.

    …So on seconds thoughts, include the venue lat/lng co-ordinates instead of the ID and use that to zoom :).

    Thread Starter uklc2004

    (@uklc2004)

    Oh my, Stephen I am the ultimate newb… I’m so glad you got back to me, but the above is like a completely different language to me.

    Is there any way you could post the code I would need to use and tell me which page and where to pop it in?

    Cheers Stephen

    Thread Starter uklc2004

    (@uklc2004)

    I do understand what lat long coordinates are though! 🙂

    Thread Starter uklc2004

    (@uklc2004)

    Hi Stephen,

    Did you happen to add the venue id, so that you can create text that links and zooms into the map location? Otherwise, is there a particular string I could use to accomplish the above?

    Thanks

    Lara

    Plugin Author Stephen Harris

    (@stephenharris)

    On a page with a map on it the venue details are stored at eventorganiser.map[0].locations.

    Keep in mind if have multiple maps on the page it could be eventorganiser.map[1].locations, eventorganiser.map[2].locations etc.

    eventorganiser.map[0].locations is an array of JS objects of the form:

    {
        "venue_id":80,
        "lat":"38.320610",
        "lng":"-108.895500",
        "tooltipContent": "...Tooltip content....
        "icon":null
      }

    E.g. eventorganiser.map[0].locations[0].venue_id gets the venue ID of the first venue on the map.

    So following above, let’s assume you have the HTML mark-up:

    <a href="#" class="venue-map-link" data-venue_id="4"> Venue A </a>

    Listen for a click on .venue-map-link and get the venue ID from it, then search for the venue in the array eventorganiser.map[0].locations, and get the lat/lng co-ordinates from that. Then you can zoom

    I realise that leaves a lot of details for you to fill to in but hopefully that will point you in the right direction…

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

The topic ‘Map marker zoom and single event layout’ is closed to new replies.