Saturday, 15 June 2013

javascript - How to change marker color in Kendo UI Map? -



javascript - How to change marker color in Kendo UI Map? -

i got next problem:

i utilize kendo ui map.

how can alter color of markers via remote data)

in exmaple got this:

data =[{"name": "test1", "shape":"pintarget", "latlng":[30.268107, -97.744821]}, {"name": "test2","shape":"mystyle", "latlng":[40.268107, -97.744821]}]; $("#map").kendomap({ center : [ 30.268107, -97.744821 ], zoom : 3, layers : [ { type : "tile", urltemplate : "http://#= subdomain #.tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png", subdomains : [ "a", "b", "c" ], attribution : "&copy; <a href='http://osm.org/copyright'>openstreetmap contributors</a>." + "tiles courtesy of <a href='http://www.opencyclemap.org/'>andy allan</a>" } ,{ type: "marker", datasource: data, locationfield: "latlng", titlefield: "name"}], });

and in css this:

.k-marker-my-style { background-image: url("styles/bootstrap/markers.png"); border: solid 1px #00f; }

i know markers pictures. how can alter these pictures addicted shape field in datasource.

in illustration when shapefield "shape":red" marker should utilize picture1.png , if shapefiled "shape": "green" marker should picture2.png.

does have idea?

greets

i think live illustration help you, http://chilifunfactory.com/blogs/factory-direct/1021/kendo-ui-map

javascript html css kendo-ui kendo-dataviz

No comments:

Post a Comment