Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #11  
Antiguo 19-02-2018
DrakStorm DrakStorm is offline
Miembro
NULL
 
Registrado: may 2013
Posts: 12
Poder: 0
DrakStorm Va por buen camino
Muchas gracias por tu ayuda lo solucione de la siguiente manera

Código Delphi [-]

procedure TFMapa.GMMark2Click(Sender: TObject; LatLng: TLatLng; Index: Integer;
  LinkedComponent: TLinkedComponent);
begin


 if GMMark2.Count > 0 then
    begin
     if CMap > 1 then
       begin
        AQmap.Active := false;
        AQmap.SQL.Text := 'select id, tipodelito, otros from oficios WHERE id="'+GMMark2.items[linkedcomponent.id - F].title+'"';
        AQmap.Active := true;
       end
        else
       begin
        AQmap.Active := false;
        AQmap.SQL.Text := 'select id, tipodelito, otros from oficios WHERE id="'+GMMark2.items[linkedcomponent.id].title+'"';
        AQmap.Active := true;
       end;

        Edit1.Text := AQmap.FieldByName('id').AsString;
        Edit2.Text := AQmap.FieldByName('tipodelito').AsString;
        Edit3.Text := AQmap.FieldByName('otros').AsString;

    end;



end;

procedure TFMapa.Button1Click(Sender: TObject);

var Marcador : TMarker;

begin

  PrincipalF.AQofi.First;

while not PrincipalF.AQofi.Eof do

    Begin

    if Principalf.AQofi.FieldByName('lat').value <> null  then
        begin
          Lat4 := Principalf.AQofi.FieldByName('lat').Value;
          Lng4 := Principalf.AQofi.FieldByName('lng').Value;
          NombreMark := Principalf.AQofi.FieldByName('id').AsString;
          marcador := GMMark2.Add(Lat4, Lng4, NombreMark);
          marcador.Icon := 'C:\ComSoft\puntoazul.png';
          I := I + 1;
        end;

     PrincipalF.AQofi.Next;
    End;
     CMap := CMap + 1;
     GMMark2.ZoomToPoints;

end;

procedure TFMapa.Button2Click(Sender: TObject);

begin

if GMMark2.Count > 0 then
    Begin
    F := I;
    GMMark2.clear;
    close;
    End;
end;

Lo que hago es contar los marcadores que se generan y luego se los resto al id del marcador solo después de la primera carga.

Se que para programadores mas expertos esto es un aborto de la naturaleza pero es lo único que se me ocurrió a mi, si tienes una solución mucho mas optima te lo agradecería mucho.

Desde ya muchas gracias por toda tu ayuda estaba muy trabado con ese tema.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 17:20:18.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi