javascript - Js:Calling a function on click -


I use maplace.js, a Google Maps JavaScript plugin for jQuery. The plugin has a function that will display the marker on the map.

map.ace.image = function (index) {// See if the trigger to show a location in the map (index === this.view_all_key) {this.o.beforeViewAll (); This.current_index = index; If (this.o.locations.length & gt; 0 & amp; amp; amp; this.o.generate_controls & amp; amp; this.current_control & amp; this.current_control.activateCurrent) {this.current_control ActivateCurrent.apply (this, [index]); } This.oMap.fitBounds (this.oBounds); This.CloseInfoWindow (); This.o.afterViewAll (); // specific location} other {index = percint (index, 10); If (typeof (index - 0) === 'number' in & amp; amp; index; gt; 0 & amp; amp; index & lt; = this.ln) {try {google.maps.event. Trigger (this.markers [index - 1], 'click'); } Catch (error) {this.debug ('ViewOnMap :: trigger', err.stack); }}} Return it; };

I tried to call this method but did not make any profit:

   

How do I call a link with the key?

You can do this:

  & lt; One class = "openmap" href = "#" & gt; Link & lt; / A & gt;  

and JS:

  $ ('. Openmap'). ('Click', function (e) {e.prevetDefault (); Maplace.prototype.ViewOnMap = function (index) {// View all, then (index === this.view_all_key) {this.o .beforeViewAll (); this.current_index = index, if (this.o.locations.length & gt; 0 & amp; amp; amp; it.o.generate_controls & amp; this.current_control & amp; This.current_control.activateCurrent) {this.current_control.activateCurrent.apply (this, [index]);} this.oMap.fitBounds (this.oBounds); this.CloseInfoWindow (); this.o.afterViewAll (); // Specific place} else {index = parseInt (index, 10); if (typeof (index - 0) === 'number' & amp; amp; index> gt; 0 and index & lt; = this.ln) {Try {google.maps.event.trigger (this.marker [Index-1], 'click');} catch (mistake) {This.debug ('ViewOnMap :: trigger', err.stack);}}} return it;};});  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -