Ver Mensaje Individual
  #11  
Antiguo 19-02-2018
DrakStorm DrakStorm is offline
Miembro
NULL
 
Registrado: may 2013
Posts: 12
Reputación: 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