From 481a09169f46910b14d7b235e3f29b5c3d6684fd Mon Sep 17 00:00:00 2001 From: Nicolas Martin Date: Tue, 16 Aug 2011 12:17:06 +0200 Subject: [PATCH] Added EventOnce class that removes the listener after the first event --- lib/GMapEventOnce.class.php | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 lib/GMapEventOnce.class.php diff --git a/lib/GMapEventOnce.class.php b/lib/GMapEventOnce.class.php new file mode 100644 index 0000000..a35c1ee --- /dev/null +++ b/lib/GMapEventOnce.class.php @@ -0,0 +1,39 @@ +getTrigger().'", '.$this->getFunction().');'; + } + + /** + * returns the javascript code for attaching a dom event once to a javascript_object + * + * @param string $js_object_name + * @return string + * @author Nicolas Martin + */ + public function getDomEventJs($js_object_name) + { + + return 'google.maps.event.addDomListenerOnce('.$js_object_name.', "'.$this->getTrigger().'", '.$this->getFunction().');'; + } + +} +