Custom Icons when using Data Binding

May 21, 2008 at 7:45 PM

Hi,

Can someone please give me an example how to use markers with different icon colors (custom icons) when Markers data is coming from a Data Source, using Data Binding?
My markers are correctly displayed in the map by using DataLatitudeField, DataLongitudeField and DataTextField, but I don't know how to control the IconURL to display different colors based on a condition.
 
Thanks,
Dan.   

Coordinator
May 22, 2008 at 6:46 AM
Hi,

There is now way to map the ImageUrl on data binding so far.
I'll add that in next release. which hope to be during this or at least at the beginning of next week - I'm just too busy recently.

Regards
May 26, 2008 at 8:42 PM
Thanks, that would be great.
Adding DataTitleField would make it even more complete. In this way I can add markers and customize the look of them and display a mouse-over tool tip.

Looking forward for you new version. Is that 3.5? 

Thanks,
Dan.
Jun 8, 2008 at 6:23 AM

 

Private Sub CargaMapagoogle()

 

 

Try

 

 

If mConn.State = Data.ConnectionState.Open Then

 

mConn.Close()

 

End If

 

 

Dim marker As Artem.Web.UI.Controls.GoogleMarker = New Artem.Web.UI.Controls.GoogleMarker

 

mConn.Open()

mCommaReader.CommandText =

"select b.num_economico," & _

 

 

"a.unidad_id as unidad_id, " & _

 

 

"a.referenciacliente as POI," & _

 

 

"a.referencia," & _

 

 

"a.fecha_hora as fecha_hora," & _

 

 

"case " & _

 

 

"when velocidad<=10 then '0'" & _

 

 

"when velocidad>10 then '1'" & _

 

 

"end as Detenido," & _

 

 

"a.velocidad," & _

 

 

"isnull(c.descripcion,'Pos. Normal') as descripcion," & _

 

 

"a.evento_id as evento_id," & _

 

 

"a.latitud," & _

 

 

"a.longitud," & _

 

 

"d.iconid as iconid," & _

 

 

"d.icourl" & _

 

 

" from " & _

 

 

"(localizacion a inner join unidades b on a.unidad_id=b.unidad_id)" & _

 

 

" left join evento c on a.evento_id= c.evento_id" & _

 

 

" join icounidad d on b.iconid= d.iconid" & _

 

 

" join permisos_unidad e on a.unidad_id=e.unidad_id "

 

 

'mCommaReader.CommandText += " where b.empresa_id='" + Session("sEmpresa") + "'"

 

mCommaReader.CommandText +=

" where e.username='" + Session("sUserName") + "'"

 

 

' se agrega la parte donde tenga latlon

 

mCommaReader.CommandText +=

" and not(latitud is null) and not(longitud is null)"

 

mCommaReader.Connection = mConn

drAutos = mCommaReader.ExecuteReader

 

Do While drAutos.Read

 

marker =

New Artem.Web.UI.Controls.GoogleMarker()

 

marker.Latitude = drAutos.Item(9).ToString

marker.Longitude = drAutos.Item(10).ToString

marker.Text =

"<b>" + drAutos.Item(0).ToString + "</b></br>" + drAutos.Item(3).ToString + "</br>" + DateTime.Now.ToString

 

marker.IconSize =

New GoogleSize(24, 24)

 

marker.IconAnchor =

New GooglePoint(10, 10)

 

marker.ImageUrl = drAutos.Item(12).ToString

GoogleMap1.Markers.Add(marker)

 

Loop

 

drAutos.Close()

mConn.Close()

 

 

Catch ex As Exception

 

 

'men2.Text = ex.ToString

 

 

'men2.Text = "Error de Red..."

 

 

End Try

 

 

End Sub