{"action":"created","issue":{"url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/75","labels_url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/75/comments","events_url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/75/events","html_url":"https://github.com/stefanocudini/leaflet-search/issues/75","id":95581196,"number":75,"title":"Leaflet Search whith Custom Icons it doesn't work ","user":{"login":"hmarina","id":4031319,"avatar_url":"https://avatars.githubusercontent.com/u/4031319?v=3","gravatar_id":"","url":"https://api.github.com/users/hmarina","html_url":"https://github.com/hmarina","followers_url":"https://api.github.com/users/hmarina/followers","following_url":"https://api.github.com/users/hmarina/following{/other_user}","gists_url":"https://api.github.com/users/hmarina/gists{/gist_id}","starred_url":"https://api.github.com/users/hmarina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hmarina/subscriptions","organizations_url":"https://api.github.com/users/hmarina/orgs","repos_url":"https://api.github.com/users/hmarina/repos","events_url":"https://api.github.com/users/hmarina/events{/privacy}","received_events_url":"https://api.github.com/users/hmarina/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-17T04:08:59Z","updated_at":"2015-08-27T15:48:46Z","closed_at":null,"body":"I am using Leaflet Control Search , when I try custom icon, the search doesn't work. \r\nI tried with  this and I dont know what I need you to change. https://github.com/stefanocudini/leaflet-search/issues/54\r\n\r\nvar test = L.icon({\r\n        iconUrl: 'test.png',\r\n\r\n        iconSize:     [38, 95], \r\n        shadowSize:   [50, 64], \r\n        iconAnchor:   [22, 94],  \r\n        shadowAnchor: [4, 62],  \r\n        popupAnchor:  [-3, -76] \r\n    });\r\n\r\n    var data =var data = [\r\n            {\"loc\":[41.575330,13.102411], \"title\":\"data1\"},\r\n            {\"loc\":[41.575730,13.002411], \"title\":\"data2\"},\r\n            {\"loc\":[41.807149,13.162994], \"title\":\"data3\"},\r\n            {\"loc\":[41.507149,13.172994], \"title\":\"data4\"}];\r\n\r\n            var markersLayer = new L.LayerGroup();  //layer contain searched elements\r\n            map.addLayer(markersLayer);\r\n\r\n            var controlSearch = new L.Control.Search({layer: markersLayer, initial: false});\r\n\r\n            map.addControl( controlSearch );\r\n\r\n\r\n            for(i in data) {\r\n                    var title = data[i].title,      \r\n                            loc = data[i].loc,        \r\n                            marker = new L.Marker(new L.latLng(loc), {icon: test},{title: title} );\r\n                    marker.bindPopup('title: '+ title );\r\n                    markersLayer.addLayer(marker);\r\n            }"},"comment":{"url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/comments/135474311","html_url":"https://github.com/stefanocudini/leaflet-search/issues/75#issuecomment-135474311","issue_url":"https://api.github.com/repos/stefanocudini/leaflet-search/issues/75","id":135474311,"user":{"login":"alexbednarczyk","id":2823855,"avatar_url":"https://avatars.githubusercontent.com/u/2823855?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbednarczyk","html_url":"https://github.com/alexbednarczyk","followers_url":"https://api.github.com/users/alexbednarczyk/followers","following_url":"https://api.github.com/users/alexbednarczyk/following{/other_user}","gists_url":"https://api.github.com/users/alexbednarczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbednarczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbednarczyk/subscriptions","organizations_url":"https://api.github.com/users/alexbednarczyk/orgs","repos_url":"https://api.github.com/users/alexbednarczyk/repos","events_url":"https://api.github.com/users/alexbednarczyk/events{/privacy}","received_events_url":"https://api.github.com/users/alexbednarczyk/received_events","type":"User","site_admin":false},"created_at":"2015-08-27T15:48:46Z","updated_at":"2015-08-27T15:48:46Z","body":"@hmarina try this\r\nFrom:\r\nmarker = new L.Marker(new L.latLng(loc), {icon: test},{title: title} );\r\nTo:\r\nmarker = new L.Marker(new L.latLng(loc), {icon: test, title: title} );"}}