Mashup Initialopeninfo on center

Home Forums MapPress Support Mashup Initialopeninfo on center

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10297
    gtayco
    Participant

    Hi,

    I was wondering if it is possible to automatically open the info window of the marker that the Mashup is centered on?

    Thanks!

    GT

    #10303
    Chris
    Keymaster

    Hi,

    The mashup doesn’t really center on a particular POI. It adjusts its center and zoom to show all of the POIs.  You can use the “initialopeninfo” parameter to open the first POI in the mashup.

    If you are using the latest beta (http://mappresspro.com/betas ) the “first” POI is the one that is alphabetically lowest (POIs are sorted alphabetically by title), for example “aaa”.

    To apply a different sort order there are two options:

    1.  The easiest way is to just turn off the default sorting using the mashup parameter sort="false".  Then you can set a POI order in your query using the clause ‘orderby’:

    show_query="post_type=post&orderby=author"

    2.  If you know some PHP, there is an action mappress_sort_pois you can use to sort the map POIs.

    You would need to implement that action in your functions.php file. You can see the default implementation in file mappress_map.php as an example.

    #10305
    gtayco
    Participant

    Thanks for the prompt response!

    We’re not using beta yet.  From the suggestions you provided, looks like we’ll be applying solution 2.

    #10369
    gtayco
    Participant

    Hi Chris,

    After a bit of work, I created a mashup with the short code below and was wondering how I can place a marker to highlight the centre_lat/lng coordinates?  I tried to use iconid=”green-dot” in the short code (based on some examples in the documentation), but it didn’t work.  Below is what I am currently using.

    [mashup show=”query” show_query=”posts_per_page=-1&category_in=x”  center_lat=”xx.xxxx” center_lng=”-xx.xxxxx” zoom=”16″ ]

    Thanks!

    #10382
    Chris
    Keymaster

    Hi, the plugin doens’t have any option to place a marker in the center.  A workaround might be to create a map with a marker in the center, though, and include that map in your mashup.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.