WordPress.org

Forums

Events Manager
[resolved] Replace Google Maps with Baidu Maps (14 posts)

  1. Kunal Nagar
    Member
    Posted 1 year ago #

    Is this possible in the plugin? If yes, can anyone just give me a starting point on how to get started with this? It would be greatly appreciated. Thanks!

    https://wordpress.org/plugins/events-manager/

  2. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Does Baidu Maps have an API or a embedding system similar to Google Maps?

  3. Kunal Nagar
    Member
    Posted 1 year ago #

    Hi there,

    Sorry for the late response.

    First of all, there is an API for Baidu Maps that is similar to the Google Maps API.

    I was going through the plugin documentation and found this link: http://wp-events-plugin.com/tutorials/modifying-event-location-google-maps/

    Here, we have the following snippet:

    jQuery(document).bind('em_maps_location_hook', function( e, map, infowindow, marker ){
    	....
    });

    Can the map object that is being returned here be replaced with a Baidu Map object? If yes, could you give some insight?

  4. angelo
    NetWebLogic Support
    Posted 1 year ago #

    here's another thread which may help you with this - http://wp-events-plugin.com/tutorials/modifying-event-location-google-maps/

  5. Kunal Nagar
    Member
    Posted 1 year ago #

    Hi Angelo.

    It is the same URL that I posted above.

  6. angelo
    NetWebLogic Support
    Posted 1 year ago #

    oops, sorry about that; at the moment this is not possible and might require lots of coding on your part.

  7. Kunal Nagar
    Member
    Posted 1 year ago #

    Lots of coding? Can't we just replace the Google Maps Object with the Baidu Maps object and hook into the events as it says in the article?

  8. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    No, because the Events Manager code is specifically targeting the features, functions calls and API of Google Maps. Using another maps provider would mean overriding all of that code.

  9. Kunal Nagar
    Member
    Posted 1 year ago #

    I have no problem overriding code as long as there are hooks available. You're saying that there are no hooks available also to override Google Maps functionality?

  10. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    Not at all, you'll find all the Google Maps related code within /includes/js/events-manager.js.

  11. Kunal Nagar
    Member
    Posted 1 year ago #

    So basically, if I get the same data that Google Maps is getting via the Baidu Maps and send it to the plugin hook that saves it as an event, you're saying it would work right?

    Just getting my facts straight, thanks for bearing with me!

  12. atommy
    Member
    Posted 1 year ago #

    kunalnagar,this question gets me puzzled,too. i used tencent Map api instead,and it worked but not perfectly,the infowindow dosen't show.have you aiready solved this problem?

  13. Kunal Nagar
    Member
    Posted 1 year ago #

    So I decided not to mess with the plugin's code.

    Basically, I am getting the data from Baidu Maps and then passing it over to the plugin hooks. The best way I have found on how to go about this is to replace the Metabox itself.

    For example, when you add a Location, there is a Where metabox. I have replaced that with my own custom metabox that takes into account Baidu Map Data. I am then using the following plugin filter to save the data:

    add_filter( 'em_location_save', array( $this, 'mm_location_save' ), 1, 2 );

    I hope that makes sense!

  14. atommy
    Member
    Posted 12 months ago #

    Great idea! But i'm not a developer,maybe i can have a try.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic