how to rebind marker

2 posts, 0 answers
  1. Mehmet Ihsan
    Mehmet Ihsan avatar
    1 posts
    Member since:
    Feb 2014

    Posted 03 Sep 2014 Link to this post

    hi everybody,
    i am tring to refill the marker.
    when the page first loading no problem very thing works perfect. But if i want to re bind the maps. Markers again same place how can i solve this problem


        Private Sub FillHareket(ByVal Usrid As String, ByVal strv As String)
            Try
                bastar = StartDate.SelectedDate
                BitTar = EndDate.SelectedDate
            Catch ex As Exception

            End Try

            Dim str As String = ""
            If CheckBox1.Checked Then
                str = "0"
            End If

            If CheckBox2.Checked Then
                If str <> "" Then
                    str += ",1"
                Else
                    str = "1"
                End If
            End If

            Dim test As String = " "
            'Usrid = "HEPSI"

            Dim ds As DataSet
            test = " SELECT * FROM ("
            If Usrid = "HEPSI" Then
                test += "SELECT (CASE WHEN THareket.Boylam=0 THEN 1 ELSE 0 END) as renk,Userid, tarih, (CASE WHEN tipi=0 THEN 'Ziyaret' ELSE 'Sipariş' END) AS Tipi, TCari.Unvan, (CASE WHEN THareket.Enlem=0 THEN 41.058175  ELSE THareket.Enlem END) AS Enlem , (CASE WHEN THareket.Boylam=0 THEN 28.80995+RAND(ROW_NUMBER() OVER (ORDER BY Tarih))/1000 ELSE THareket.Boylam END) AS Boylam, Miktar, Tutar,cast( resim1 as nvarchar(200)) as resim1,cast( resim2 as nvarchar(200)) as resim2,cast( resim3 as nvarchar(200)) as resim3,cast( resim4 as nvarchar(200)) as resim4,THareket.EvrakNo, (CASE WHEN THareket.Boylam=0 THEN 1 ELSE 0 END) AS GPSYOK ,'' as carino ,'' as BolgeKodu FROM THareket INNER JOIN TCari ON THareket.CariNo=TCari.CariNo  WHERE (Tarih>=@Tarihbas AND Tarih<@Tarihbit) and thareket.tipi in (" + str + ") "
                'test += "SELECT (CASE WHEN THareket.Boylam=0 THEN 1 ELSE 0 END) as renk,Userid, tarih, (CASE WHEN tipi=0 THEN 'Ziyaret' ELSE 'Sipariş' END) AS Tipi, TCari.Unvan, (CASE WHEN THareket.Enlem=0 THEN 41.058175  ELSE THareket.Enlem END) AS Enlem , (CASE WHEN THareket.Boylam=0 THEN 28.80995+RAND(ROW_NUMBER() OVER (ORDER BY Tarih))/1000 ELSE THareket.Boylam END) AS Boylam, Miktar, Tutar,cast( resim1 as nvarchar(200)) as resim1,cast( resim2 as nvarchar(200)) as resim2,cast( resim3 as nvarchar(200)) as resim3,cast( resim4 as nvarchar(200)) as resim4,THareket.EvrakNo, (CASE WHEN THareket.Boylam=0 THEN 1 ELSE 0 END) AS GPSYOK ,'' as carino ,'' as BolgeKodu FROM THareket INNER JOIN TCari ON THareket.CariNo=TCari.CariNo  WHERE thareket.tipi='0' "
            Else
                test += "SELECT (CASE WHEN THareket.Boylam=0 THEN 1 ELSE 0 END) as renk,Userid, tarih, (CASE WHEN tipi=0 THEN 'Ziyaret' ELSE 'Sipariş' END) AS Tipi, TCari.Unvan, (CASE WHEN THareket.Enlem=0 THEN 41.058175  ELSE THareket.Enlem END) AS Enlem , (CASE WHEN THareket.Boylam=0 THEN 28.80995+RAND(ROW_NUMBER() OVER (ORDER BY Tarih))/1000 ELSE THareket.Boylam END) AS Boylam, Miktar, Tutar,cast( resim1 as nvarchar(200)) as resim1,cast( resim2 as nvarchar(200)) as resim2,cast( resim3 as nvarchar(200)) as resim3,cast( resim4 as nvarchar(200)) as resim4,THareket.EvrakNo, (CASE WHEN THareket.Boylam=0 THEN 1 ELSE 0 END) AS GPSYOK ,'' as carino ,'' as BolgeKodu FROM THareket INNER JOIN TCari ON THareket.CariNo=TCari.CariNo  WHERE " & IIf(Usrid <> "", "Userid='" & Usrid & "' AND", "") & "  (Tarih>=@Tarihbas AND Tarih<@Tarihbit) and thareket.tipi in (" + str + ") "
            End If

            If CheckBox3.Checked Then
                test += IIf(CheckBox1.Checked Or CheckBox2.Checked, " union ", "")
                test += "SELECT '3' as renk,'' as Userid,''as tarih,'Bayi' as Tipi, TCari.Unvan AS Unvan, MAX(TDHareket.Enlem) AS Enlem, MAX(TDHareket.Boylam) AS Boylam,0 as Miktar,0 as Tutar,'' as resim1,'' as  resim2,'' as resim3,'' as resim4,'' as EvrakNo,0 as GPSYOK  ,TDHareket.carino AS CariNo, TCari.BolgeKodu FROM TDHareket INNER JOIN TCari ON TDHareket.Carino=TCari.carino where   TDHareket.Enlem<>0 AND TDHareket.Boylam<>0 "
                If Usrid = "HEPSI" Then
                    test += " GROUP BY TDHareket.carino, TCari.Unvan, TCari.BolgeKodu"
                Else
                    test += " and TCari.BolgeKodu='" + HiddenField5.Value + "' GROUP BY TDHareket.carino, TCari.Unvan, TCari.BolgeKodu"
                End If

            End If

            Dim _param(1) As SqlParameter
            _param(0) = New SqlParameter("@Tarihbas", bastar)
            _param(1) = New SqlParameter("@Tarihbit", BitTar)
            test += " )as G ORDER BY GPSYOK,Tipi desc,Tarih desc"
            ds = GetData(test, _param, Nothing)

            If ds.Tables.Count > 0 Then
                RadGrid2.DataSource = ds
                RadGrid2.DataBind()
            End If

            RadMap1.DataSource = ds
            RadMap1.DataBind()

        End Sub
  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 04 Sep 2014 Link to this post

    Hi Mehmet,

    I am afraid that I am unable to understand what exactly is the issue encountered on your end.

    If additional markers are added on the map after subsequent binding, but the old one are not cleared, I suggest verifying of the AppendDataBoundMarkers property is set to true somewhere in the markup of the RadMap or in the code behind.

    If this is not the case, please try building a locally runnable sample web page, taht can be used to reproduce the issue and investigate it further.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top