{"action":"opened","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3016","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-js","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3016/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3016/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/3016/events","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/3016","id":171556936,"number":3016,"title":"Allow clusters to be by rendered features only","user":{"login":"steinbachr","id":1424445,"avatar_url":"https://avatars.githubusercontent.com/u/1424445?v=3","gravatar_id":"","url":"https://api.github.com/users/steinbachr","html_url":"https://github.com/steinbachr","followers_url":"https://api.github.com/users/steinbachr/followers","following_url":"https://api.github.com/users/steinbachr/following{/other_user}","gists_url":"https://api.github.com/users/steinbachr/gists{/gist_id}","starred_url":"https://api.github.com/users/steinbachr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steinbachr/subscriptions","organizations_url":"https://api.github.com/users/steinbachr/orgs","repos_url":"https://api.github.com/users/steinbachr/repos","events_url":"https://api.github.com/users/steinbachr/events{/privacy}","received_events_url":"https://api.github.com/users/steinbachr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-17T01:51:17Z","updated_at":"2016-08-17T01:51:17Z","closed_at":null,"body":"Consider the case where we're clustering the prices of homes on a map and as the value of the cluster, we want to show the minprice of the homes in the cluster. The actual display of the minprice as the cluster value isn't a requirement for this issue, I just wanted to give a bump to #2412 because it's vital to our use case ;). \r\n\r\nAnyways, say we then want to apply a filter to only show homes with a price of >$200,000. At a non-cluster layer level, this works just fine with the application of a `filter`. However, for cluster layers, the `point_count` includes all features, not just those rendered. I propose an extension to the source API such that the following be a valid declaration:\r\n\r\n```\r\n\"type\": \"geojson\",\r\n\"cluster\": true,\r\n\"clusterTarget\": 'rendered' // <-- where this could be either 'rendered' or 'source' (defaulting to source)\r\n\"clusterRadius\": 50\r\n\"clusterMaxZoom\": 5,\r\n\"data\": ..\r\n```\r\n\r\nOR, alternatively:\r\n\r\n```\r\n\"type\": \"geojson\",\r\n\"cluster\": true,\r\n\"clusterRendered\": true, // <-- defaulting to false\r\n\"clusterRadius\": 50\r\n\"clusterMaxZoom\": 5,\r\n\"data\": ..\r\n```"}}
{"actor":{"display_login":"steinbachr"}}