[Cartoweb-users] writing new plugin

oliver oliver.christen at camptocamp.com
Wed Mar 1 03:23:51 EST 2006


Hi Giuseppe,

did you add "implements FilterProvider " in your plugin class definition ? Otherwise your plugin wont understand what are filterGetRequest and filterPostRequest

otherwise, try doing a x($request) in your filterPostRequest function to see whats inside and eventually see if something is wrong.

Regards,
Oliver
  ----- Original Message ----- 
  From: giuseppe.derossi at email.it 
  To: oliver 
  Cc: cartoweb-users at lists.maptools.org 
  Sent: Wednesday, March 01, 2006 9:03 AM
  Subject: Re: [Cartoweb-users] writing new plugin


  Hi,
  I fixed the first error, due to a naming error. Now, the plug in is found but I get the following error:

  Class : CartocommonExceptionMessage : Error [8, Undefined property:  ClientRicerca::$request, C:\wamp\www\cartoweb3\projects\MyProject\plugins\Ricerca\client\ClientRicerca.php, 21]


  My target consists on building up a new recenter plugin. I've followed the indications into HowToWriteANewRecenterPlugIn. This new plugin gets a text string (name of a building and so on) and recenters the map on the specific point. In  a db, there is the relation between name and coordinates. 
  I've created a new folder and put the template into it, and that is ok, the plugin find the coordinates but than it crashes and returns the error above.
  That is my code :


  public function filterGetRequest(FilterRequestModifier $request) {}

      public function filterPostRequest(FilterRequestModifier $request) {
      $searchString = $request->getValue('buildName');
      if (!empty($searchString)) {

          // To simplify we assume that only one result is returned by the search
          list($x, $y) = $this->makeSearch($searchString);

          $this->request->setValue('recenter_x', $x);  (1)
          $this->request->setValue('recenter_y', $y);  (2)

      }

  protected function makeSearch($searchString) {
   // db connection atc.

   return array($x, $y);

  }

  If I delete the lines (1) and (2) there's no error but I don't get the recentering. Can you help me?
  Is  there a way to set a fixed zoom so I get a visible map in a time ?

  In my not-smarty plugin, I've set the distances for x and y to set a fixed box around the found center.

  Thanks in advantage


    --------- Original Message --------
    Da: "oliver" <oliver.christen at camptocamp.com>
    To: 
    Cc: cartoweb-users at lists.maptools.org
    Oggetto: Re: [Cartoweb-users] writing new plugin
    Data: 27/02/06 09:06


    Hi Giuseppe,
    first, be sure you didnt used any function that require a server side ( your plugin must not implements ServerCaller), 
    also you must not call your plugin on the server side (in server_conf/yourproject/yourproject.ini it must not be in loadPlugins = ...)
    otherwise it may be something to do with the functions or objects you have used but i cant say without seeing your actual code.

    Regards,
    Oliver

      ----- Original Message ----- 
      From: giuseppe.derossi at email.it 
      To: Alexandre Saunier 
      Cc: cartoweb-users at lists.maptools.org 
      Sent: Sunday, February 26, 2006 11:40 PM
      Subject: Re: [Cartoweb-users] writing new plugin


      Hi Alexandre,
      in my first attemp, I wrote a new feature by linking a new  html/php page in the main page, the results is ok but it's no too "smarty", then I've just tried to follow the suggested procedures,   HowToWriteaRecenterPlugin,  Ive called my new plugin  myPlugin (what a immagination ), but when I recall my project (which works fine in Cartoweb 3.2 ) I get : 

      Couldn't load plugin ServerMyPlugin.
       
      No errors during the compilation. I've not written any server plugin, but it seems I 'm not supposed to do .
      what's wrong ?

      Thanks in advantage.



        



        --------- Original Message --------
        Da: "Alexandre Saunier" <alexandre.saunier at camptocamp.com>
        To: 
        Cc: cartoweb-users at lists.maptools.org
        Oggetto: Re: [Cartoweb-users] writing new plugin
        Data: 21/02/06 13:50



        Hello,

        have a look at this tutorial:
        http://cartoweb.org/cwiki/HowToWriteaRecenterPlugin

        The plugin writing principles are obviously the same for other kinds of 
        plugins...

        AS



      ----
      Email.it, the professional e-mail, gratis per te: clicca qui 

      Sponsor:
      Campioni GRATIS: Più di 6 milioni di persone si sono affidate a VistaPrint Scopri perché. 
      Clicca qui 




--------------------------------------------------------------------------


      _______________________________________________
      Cartoweb-users mailing list
      Cartoweb-users at lists.maptools.org
      http://lists.maptools.org/mailman/listinfo/cartoweb-users



  ----
  Email.it, the professional e-mail, gratis per te: clicca qui 

  Sponsor:
  Scopri come proteggere dai virus il tuo computer e come eliminare ogni tipo di virus! - clicca qui
  Clicca qui 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20060301/578e2c36/attachment-0001.html


More information about the Cartoweb-users mailing list