Einzelnen Beitrag anzeigen

azrin.aris

Registriert seit: 25. Dez 2011
3 Beiträge
 
#165

AW: Google Maps über COM (Component Object Model)

  Alt 28. Dez 2011, 16:15
Hi Azrin,

thank you very much! Unfortunately I have only Delphi and not RAD Studio, so I could test it yet. If there are problems again, please tell about it!
Hi Thom,

I mange to port 2 of your samples int C++ Builder. Now I'm trying to port one of Events sample - the DOMListener sample. Unfortunately, I stuck

here is the code in Delphi (from your sample)
Delphi-Quellcode:
    {$IFDEF USE_ANONYMOUS_METHODS}
    Google.Maps.Event.AddDomListener(Map.Container,'click',NewFunction(
      procedure(Sender: TObject)
      var
        Event: TJScriptObject;
      begin
        //'Sender' is the TJScriptObject that was created with 'NewFunction()'
        //The 'click' event has one parameter - a object with the x and y
        //position of the click.
        Event:=TJScriptObject(CreateObjectWrapper(Script,TJScriptObject,
                                                  TJScriptFunction(Sender).Arguments[0]));
        ShowMessage('DIV clicked'+', ('+
                    'x: '+IntToStr(Event.Properties['x'])+', '+
                    'y: '+IntToStr(Event.Properties['y'])+')');
      end));
    {$ELSE}
    Google.Maps.Event.AddDomListener(Map.Container,'click',NewFunction(DIVClick));
    {$ENDIF}
I also attached here are the C++ codes that I manage to port and compile and is working
Angehängte Dateien
Dateityp: zip Control Options-CBXE2.zip (76,2 KB, 55x aufgerufen)
Dateityp: zip Icon Complex-CBXE2.zip (76,8 KB, 56x aufgerufen)
  Mit Zitat antworten Zitat