This is a migrated thread and some comments may be shown as answers.

how to rebind marker

1 Answer 68 Views
Map
This is a migrated thread and some comments may be shown as answers.
Mehmet Ihsan
Top achievements
Rank 1
Mehmet Ihsan asked on 03 Sep 2014, 08:50 AM
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

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 04 Sep 2014, 01:32 PM
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.

 
Tags
Map
Asked by
Mehmet Ihsan
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or