{"id":1380,"url":"https://github.com/jamesdouble/JDSwiftHeatMap","last_synced_at":"2025-08-02T04:31:00.948Z","repository":{"id":22701984,"uuid":"94406515","full_name":"jamesdouble/JDSwiftHeatMap","owner":"jamesdouble","description":"JDSwiftMap is an IOS Native MapKit Library.  You can easily make a highly customized HeatMap.","archived":false,"fork":false,"pushed_at":"2022-05-31T16:33:39.000Z","size":2134,"stargazers_count":148,"open_issues_count":6,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-12T01:41:59.319Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.jianshu.com/p/d56a5cf62cc7","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesdouble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-15T06:18:50.000Z","updated_at":"2025-02-27T05:15:11.000Z","dependencies_parsed_at":"2022-09-04T07:50:37.606Z","dependency_job_id":null,"html_url":"https://github.com/jamesdouble/JDSwiftHeatMap","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jamesdouble/JDSwiftHeatMap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdouble%2FJDSwiftHeatMap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdouble%2FJDSwiftHeatMap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdouble%2FJDSwiftHeatMap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdouble%2FJDSwiftHeatMap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesdouble","download_url":"https://codeload.github.com/jamesdouble/JDSwiftHeatMap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesdouble%2FJDSwiftHeatMap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334610,"owners_count":24233793,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:15:45.127Z","updated_at":"2025-08-02T04:31:00.561Z","avatar_url":"https://github.com/jamesdouble.png","language":"Swift","funding_links":[],"categories":["Maps"],"sub_categories":["Other Hardware","Other free courses"],"readme":"![Alt text](https://raw.githubusercontent.com/jamesdouble/JDSwiftHeatMap/master/Readme_img/logo.png?token=AJBUU8PbfD_WRNgAB4UEqbt1vDhm2iS3ks5ZbgTowA%3D%3D)\n\n**JDSwiftMap** is an IOS Native MapKit Library.\n\nYou can easily make a highly customized HeatMap.\n\n![Alt text](https://img.shields.io/badge/SwiftVersion-4.0+-red.svg?link=http://left\u0026link=http://right)\n![Alt text](https://img.shields.io/badge/IOSVersion-9.0+-green.svg)\n![Alt text](https://img.shields.io/badge/BuildVersion-1.0.0-green.svg)\n![Alt text](https://img.shields.io/badge/Author-JamesDouble-blue.svg?link=http://https://jamesdouble.github.io/index.html\u0026link=http://https://jamesdouble.github.io/index.html)\n\n\n![Alt text](https://raw.githubusercontent.com/jamesdouble/JDSwiftHeatMap/master/Readme_img/jdheatmapDemo.png?token=AJBUU1UA_L_wx5f_E3iRsaUGAh_xg3pCks5Zb1yIwA%3D%3D)\n\n# Installation\n* Cocoapods\n\n```\n\tpod 'JDSWiftHeatMap'\n```\n\n\n# Usage\n\nJDSwiftHeatMap is based on **IOS native MKMapView**, \n\nso you must familiar with.\n\n## Init\n\n*  Give a frame. \n*  Follow JDHeatMapDelegate.\n*  Choose a MapType Below\n\n```Swift\n  map = JDRealHeatMap(frame: self.view.frame, delegate: self, maptype: .FlatDistinct)\n  self.view.addSubview(map!)\n```\n\n### With ColorSetting\n```Swift\n  map = JDSwiftHeatMap(frame: mapsView.frame, delegate: self, maptype: .FlatDistinct, BasicColors: [UIColor.yellow,UIColor.red], devideLevel: 2)\n  self.view.addSubview(map!)\n```\nBasicColors is element color array.\n\nDevide Level = How Many Middle Colors between Basic Colors.\n\n## Delegate - Most Important\n\nThere are two delegate you need to pay close.\n \n1. ***MKMapViewDelegate*** - (Optional)\n\n\tThis is the delegate you familiar,( AnnoationView For.., Render For...) You sure can use this delegate in old way, or not to follow this delegate.\n\t\t\n\t **But if you do, you may need to follow two essential function.**\n\t \n\t ```Swift\n\textension ViewController:MKMapViewDelegate\n\t{\n\t\tfunc mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -\u003e MKOverlayRenderer\n\t\t {\n        \tif let heatoverlay = map?.heatmapView(mapView, rendererFor: overlay)\n        \t{\n          \t  return heatoverlay\n        \t}\n        \telse\n        \t{\n        \t    var yourownRender = yourownRenderClass()\n        \t    return yourownRender\n        \t}\n    \t}\n    \n   \t\tfunc mapViewWillStartRenderingMap(_ mapView: MKMapView)\n   \t\t {\n        \tmap?.heatmapViewWillStartRenderingMap(mapView)\n    \t}\n\t}\n  \tmap.delegate = self\n  \t\n\t```\n\t\n2. ***JDHeatMapDelegate***\n\t\n\tWhen we talk to Heat Map, the most important thing is ***\"Data\"*** ! You should provide the data you want to display in this delegate.\n\t\n\t```Swift\n\tpublic protocol JDHeatMapDelegate {\n    func heatmap(HeatPointCount heatmap:JDRealHeatMap) -\u003e Int\n    func heatmap(HeatLevelFor index:Int) -\u003e Int\n    @Optional func heatmap(RadiusInKMFor index:Int) -\u003e Double\n    func heatmap(CoordinateFor index:Int) -\u003e CLLocationCoordinate2D\n\t}\n\t```\n\t*The default radius in km is 100KM.*\n\n### Notice\n\nMore data will cause **large memory using**, should be notice.\n\n## Setting\n\n1. public func setType(type:JDMapType) \n\n\tchange the display type, it will refresh automatically.\n\t\n2. public func refresh()\n\n\tCall this function when data changed.\n\t\n3. public var showindicator:Bool\n\t \n\tSet the loading indicator showing or not.\n\t \n\t \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesdouble%2FJDSwiftHeatMap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesdouble%2FJDSwiftHeatMap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesdouble%2FJDSwiftHeatMap/lists"}