I did send this by E-Mail at 10.03.2017, unfortunately I didn’t get a reply, so I write here too.

Dear Flippercode Author,

first, thanky you very much for this great plugin!

My company bought this plugin for one of our customer.

I like to do something like, if I click on a pin on the map, will open an accordion tab on the page.
Also if I click on the accordion tab, I like to open the location info window.
I find, your plugin has PHP hooks, but not JavaScript hooks, also I read on the https://www.flippercode.com/forums/, some user may want it.

How can I open a location infowindow from my scripts.js?

like $( map2 ).open_infowindow(9); <- 9 is the ID of marker.

—————————————————————————
A FEATURE SUGGESTION:

I did some search and find a JavaScript Hook sytem, what you could build in your plugin.
https://github.com/carldanley/WP-JS-Hooks

You do not have to include the https://github.com/carldanley/WP-JS-Hooks/blob/master/build/event-manager.min.js file,
that you can leave to the customer.

What you could do, is insert some action and/or filters to your JavaScript file, like:

if ( typeof wp.hooks !== 'undefined' ) wp.hooks.doAction( 'wp-google-map-gold-pin-clicked', place );

inside wp-google-map-gold/assets/js/maps.js line 3136.
Not only here, this is just an example, so I can use the "openAccordion" function.

Maybe the hook name can be shorter.

Then I (or any other customer) can include the evenet-manager.min.js file inside the theme/plugin and do something like this in scripts.js:

if ( typeof wp.hooks !== 'undefined' ) {
wp.hooks.addAction( 'wp-google-map-gold-pin-clicked', function( place ){
openAccordionTab( '#' + place.location.extra_fields.id );
}, 10 );
}

I already did this, in my version of the plugin, but it will be nice, if I could use more JavaScript hooks, and I do not have to add this after every update.
—————————————————————————

Best regards,

Joe

Public
Hello,
Thanks for your valuable suggestion. And definiately we'll discuss this in our discussion meeting. You'll get email from codecanyon.net when we release a new version with features list.
Thanks
#1
Public
Thank you!
I may misunderstood you, but is it possible to open a location infowindow from my eg. scripts.js in the current version?
#2

Please login or Register to Submit Answer