ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Loading JSON file with AJAX for Google maps

February 08, 2012 11:46am

Subscribe [1]
  • #1 / Feb 08, 2012 11:46am

    zizther

    228 posts

    I have a Google map which displays 1000’s of markers, what i want to do is just load a certain amount of markers from the current location, a bit like how property / estate agent websites have.

    What i want to do is load a JSON file with the results, how is it possible to query EE to produce a JSON file with the entries from the location on the map?

    Thanks

  • #2 / Feb 09, 2012 3:17pm

    Dan Decker

    7338 posts

    Hi zizther,

    I’m not entirely clear on your request. Do you want ExpressionEngine to output JSON via channel entries to your map, or the other way around?

    ExpressionEngine will output JSON simply by formatting your template in a JSON schema.

    Cheers,

  • #3 / Feb 10, 2012 4:01am

    zizther

    228 posts

    Thanks Dan, i think that is what i was looking for, I guess i can then use AJAX to dynamically pull results from EE?

  • #4 / Feb 13, 2012 3:30pm

    Dan Decker

    7338 posts

    zizther,

    Correct, you would do something similar:

    {exp:channel:entries
      channel='my-channel'
      limit='5'
      status='not closed'
      orderby='title'
    }
    {"title": "{title}", "body": "{body}"} 
    {/exp:channel:entries}

    Cheers!

  • #5 / Feb 14, 2012 9:33am

    zizther

    228 posts

    Thanks Dan!

  • #6 / Feb 15, 2012 5:03pm

    Dan Decker

    7338 posts

    Hi zizther,

    My pleasure!

    If you have any other questions, feel free to open a new thread.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases