Hi, 2010/7/12 Fabrice Bernhard <[email protected]>: > Ok so this is actually a working strategy ? I will implement it and > name the function initialize 'intiialize_'.$map_name by default so > that users don't need to actually change this parameter unless they > need to. > > Concerning the javascript_name of the map, one soulution could be to > generate automatically a new one for every new instance : > > 'map', 'map1', 'map2', etc. > > Do you people actually instanciate many times the same map or not ?
Where can I find this code? > > Fabrice > > On Jul 11, 5:19 pm, Mathieu Comandon <[email protected]> wrote: >> I've submitted a quick n'dirty patch on the plugin's bugtracker, for >> those who want to integrate it manually, here's what it looks like : >> >> ---------------------------------- >> >> --- GMap.class.php >> +++ GMap.class.php2 >> @@ -87,6 +87,7 @@ >> protected $parameters = array( >> 'js_name' => 'map', >> 'onload_method' => 'js', >> + 'init_function' => 'initialize', >> 'api_keys' => null >> ); >> >> @@ -298,6 +299,12 @@ >> { >> >> return $this->parameters['js_name']; >> + } >> + >> + >> + public function getInitFunction() >> + { >> + return $this->parameters['init_function']; >> } >> >> /** >> @@ -394,14 +401,15 @@ >> switch ($this->parameters['onload_method']) >> { >> case 'jQuery': >> - return 'jQuery(document).ready(function(){initialize();});'; >> + case 'jquery': >> + return 'jQuery(document).ready(function(){' . >> $this->getInitFunction() . '();});'; >> >> break; >> case 'prototype': >> - return 'document.observe("dom:loaded", function() >> {initialize();});'; >> + return 'document.observe("dom:loaded", function(){' . >> $this->getInitFunction() . '();});'; >> >> break; >> default: >> case 'js': >> - return 'window.onload = function(){initialize()};'; >> + return 'window.onload = function(){' . $this->getInitFunction() . >> '()};'; >> >> break; >> } >> } >> @@ -443,7 +451,7 @@ >> } >> $return .= ' >> // Call this function when the page has been loaded >> - function initialize() >> + function ' . $this->getInitFunction() . '() >> {'; >> foreach($init_events as $init_event) >> { >> >> ---------------------------------- >> >> It currently only works with the jQuery onload method, you'll have to >> instantiate your maps like this : >> >> $this->gMap = new GMap(array(),array(),array('id' => >> 'map1'),array('js_name' => 'map1', 'init_function' => 'init_map1', >> 'onload_method' => 'jQuery')); >> >> $this->gMap_2 = new GMap(array(),array(),array('id' => >> 'map2'),array('js_name' => 'map2', 'init_function' => 'init_map2', >> 'onload_method' => 'jQuery')); > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- Best regards, Michal Sent from my fscking awesome Black Hole Generator -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
