WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Resolved] Replace Google Maps with Baidu Maps

[Resolved] Replace Google Maps with Baidu Maps

Viewing 13 replies - 1 through 13 (of 13 total)
  • caimin_nwl

    @caimin_nwl

    NetWebLogic Support

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

    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?

    angelo_nwl

    @angelo_nwl

    NetWebLogic Support

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

    Hi Angelo.

    It is the same URL that I posted above.

    angelo_nwl

    @angelo_nwl

    NetWebLogic Support

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

    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?

    caimin_nwl

    @caimin_nwl

    NetWebLogic Support

    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.

    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?

    caimin_nwl

    @caimin_nwl

    NetWebLogic Support

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

    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!

    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?

    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!

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

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Resolved] Replace Google Maps with Baidu Maps’ is closed to new replies.
Skip to toolbar