Allow shortcode to specify latitude and longitude

This topic contains 5 replies, has 4 voices, and was last updated by  Stiofan O’Connor 8 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #66017

    johan
    Free User
    Post count: 93

    I don’t see a forum for enhancement requests so please let me know if I should make the request somewhere else.

    I have menu items on my website for maps of the small towns in our community.

    http://jaltembadirectory.com/maps/chacala-map/

    They are pages with a shortcode for the home map. They zoom the map to that community by specifying the latitude and longitude. eg. [gd_homepage_map width=100% height=500 scrollwheel=true child_collapse=true latitude=21.163909141320662 longitude=-105.22250089386215 zoom=16 autozoom=false]

    I specify latitude, longitude and zoom to get the map to show just that community.

    BUT that shortcode does not allow lat and long to be specified so I had to patch geodirectory_shortcodes.php and map.js.

    I would like to know:

    Is there a way to do this without a patch?
    Is there a hook where I could put the patches?

    If not I would like to suggest that the latitude and longitude be added to the SC by something like this in function geodir_sc_home_map($atts):

    ‘map_class_name’ => ‘geodir-map-home-page’,
    ‘is_geodir_home_map_widget’ => true,
    //johan allow the short code to specify the latitude and longitude
    ‘latitude’ => $atts[‘latitude’],
    ‘longitude’ => $atts[‘longitude’],
    //johan to here
    );
    //johan tell map.js to leave the center of the map alone if latitude and longitude were specified.
    if (isset($atts[‘latitude’]))
    $map_args[‘map_canvas_name’] = ‘gd_home_map_latset’;
    //johan to here

    // Add marker cluster

    #66022

    johan
    Free User
    Post count: 93
    This reply has been marked as private.
    #66023

    Guust
    Moderator
    Post count: 29970

    I cannot see any listings on that page at all.
    Requests can be added here: https://wpgeodirectory.com/requests/

    I’ll get Paolo to have a look at your topic too.

    #66027

    johan
    Free User
    Post count: 93

    Right Guust. I was fixing some bugs but it should work now. Thanks for the quick response.

    #66083

    Paolo
    Site Admin
    Post count: 31206

    HI,

    I’ve asked to Stiofan to tell us what he thinks of your code. Features requests in general should be submitted here: https://wpgeodirectory.com/requests/

    So that other members can vote for them and most voted are taken into consideration.

    However if you have the code ready made, you could make a pull request on Github directly and Stiofan would either deny it or approve it and in the second case it would be directly included in the next release.

    https://github.com/GeoDirectory/geodirectory

    Thanks

    #66228

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Johan,

    Please replace this file in core and test: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory_shortcodes.php

    Thanks,

    Stiofan

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket