dynamic legend for tiles in Leaflet

المشرف العام

Administrator
طاقم الإدارة
Good day dear professionals! I have a little problem. I started to learn javascript and leaflet not so much time ago, and now I can work with layers, but creating controls that I need is to hard for me right now. So, I created tile layer based on polygon shape-file(it is realy big, around 14 000 000 points. geojson,topojson - can't display it in browser, shape-files I prefer not to use) and now I try to create bicycle again. I want to create dynamic legend. One part of legend use for detecting of color and displaying type of polygon by color(hex). Another part use for 3-5 dominate colors of chosen map in different positions. So I show some pieces of code:

1) http://jsfiddle.net/DV9Bw/1/

2) Second part is look like (As I think I can use it) http://lokeshdhakar.com/projects/color-thief/

How to create legend that I describe?Any Ideas, my friends? As I understand - I should create canvas tile layer and then get pixel color...

P.S. sorry for my english! I haven't practice for a long time =)



أكثر...
 
أعلى