{"action":"created","issue":{"url":"https://api.github.com/repos/tim-salabim/leaflet.glify/issues/4","repository_url":"https://api.github.com/repos/tim-salabim/leaflet.glify","labels_url":"https://api.github.com/repos/tim-salabim/leaflet.glify/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/tim-salabim/leaflet.glify/issues/4/comments","events_url":"https://api.github.com/repos/tim-salabim/leaflet.glify/issues/4/events","html_url":"https://github.com/tim-salabim/leaflet.glify/issues/4","id":375070065,"node_id":"MDU6SXNzdWUzNzUwNzAwNjU=","number":4,"title":"Color problem when using different tiles providers?","user":{"login":"BastienFR","id":10979480,"node_id":"MDQ6VXNlcjEwOTc5NDgw","avatar_url":"https://avatars1.githubusercontent.com/u/10979480?v=4","gravatar_id":"","url":"https://api.github.com/users/BastienFR","html_url":"https://github.com/BastienFR","followers_url":"https://api.github.com/users/BastienFR/followers","following_url":"https://api.github.com/users/BastienFR/following{/other_user}","gists_url":"https://api.github.com/users/BastienFR/gists{/gist_id}","starred_url":"https://api.github.com/users/BastienFR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BastienFR/subscriptions","organizations_url":"https://api.github.com/users/BastienFR/orgs","repos_url":"https://api.github.com/users/BastienFR/repos","events_url":"https://api.github.com/users/BastienFR/events{/privacy}","received_events_url":"https://api.github.com/users/BastienFR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":27,"created_at":"2018-10-29T15:21:33Z","updated_at":"2018-11-01T11:46:01Z","closed_at":null,"author_association":"NONE","body":"I've noticed the the color used to with `addGlifyPolygons` doesn't work for all tile providers.\r\n\r\nSee RE:\r\n\r\n```\r\n# loading the libraries\r\nlibrary(sf)  \r\nlibrary(leaflet)\r\nlibrary(leaflet.glify)\r\nlibrary(colourvalues)\r\n\r\n# preparing the shapefile\r\nnc <- st_read(system.file(\"gpkg/nc.gpkg\", package=\"sf\"), quiet = TRUE) %>% \r\n  st_transform(st_crs(4326)) %>% \r\n  st_cast('POLYGON')\r\n\r\n# setting the colors\r\ncols = colour_values_rgb(nc$AREA, palette = \"inferno\", include_alpha = FALSE) / 255\r\n\r\n# making the first map like in your example:\r\nleaflet() %>%\r\n  addProviderTiles(provider = providers$CartoDB.DarkMatter) %>%\r\n  leaflet.glify:::addGlifyPolygons(nc, color = cols) %>% \r\n  fitBounds(lng1 = unname(st_bbox(nc)$xmin), lng2 = unname(st_bbox(nc)$xmax), lat1 = unname(st_bbox(nc)$ymin), lat2 = unname(st_bbox(nc)$ymax))\r\n```\r\n\r\n![image](https://user-images.githubusercontent.com/10979480/47658767-ee3fae80-db69-11e8-9ebb-a8c233042565.png)\r\n\r\n\r\n```\r\n# making the second map with a different tile provider:\r\nleaflet() %>%\r\n  addProviderTiles(provider = providers$OpenStreetMap.Mapnik) %>%\r\n  leaflet.glify:::addGlifyPolygons(nc, color = cols) %>% \r\n  fitBounds(lng1 = unname(st_bbox(nc)$xmin), lng2 = unname(st_bbox(nc)$xmax), lat1 = unname(st_bbox(nc)$ymin), lat2 = unname(st_bbox(nc)$ymax))\r\n```\r\n![image](https://user-images.githubusercontent.com/10979480/47658798-fe578e00-db69-11e8-9761-1cba2212ed6d.png)\r\n\r\nDo you know what the problem is?\r\n"},"comment":{"url":"https://api.github.com/repos/tim-salabim/leaflet.glify/issues/comments/435016197","html_url":"https://github.com/tim-salabim/leaflet.glify/issues/4#issuecomment-435016197","issue_url":"https://api.github.com/repos/tim-salabim/leaflet.glify/issues/4","id":435016197,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTAxNjE5Nw==","user":{"login":"BastienFR","id":10979480,"node_id":"MDQ6VXNlcjEwOTc5NDgw","avatar_url":"https://avatars1.githubusercontent.com/u/10979480?v=4","gravatar_id":"","url":"https://api.github.com/users/BastienFR","html_url":"https://github.com/BastienFR","followers_url":"https://api.github.com/users/BastienFR/followers","following_url":"https://api.github.com/users/BastienFR/following{/other_user}","gists_url":"https://api.github.com/users/BastienFR/gists{/gist_id}","starred_url":"https://api.github.com/users/BastienFR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BastienFR/subscriptions","organizations_url":"https://api.github.com/users/BastienFR/orgs","repos_url":"https://api.github.com/users/BastienFR/repos","events_url":"https://api.github.com/users/BastienFR/events{/privacy}","received_events_url":"https://api.github.com/users/BastienFR/received_events","type":"User","site_admin":false},"created_at":"2018-11-01T11:46:01Z","updated_at":"2018-11-01T11:46:01Z","author_association":"NONE","body":"sadly I get the same behaviour:\r\n\r\n![image](https://user-images.githubusercontent.com/10979480/47849960-ebcb9780-dda9-11e8-8270-433508a283bf.png)\r\n\r\n\r\nAnd while doing this test, I've notice I lose the shape when I resize my window and move it around\r\n\r\nP.S.  That test was done on windows."}}
{"actor":{"display_login":"BastienFR"}}