Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HeatMap not visible when it is zoomed in. #371

Open
gurjnderSingh opened this issue Apr 30, 2021 · 7 comments
Open

HeatMap not visible when it is zoomed in. #371

gurjnderSingh opened this issue Apr 30, 2021 · 7 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@gurjnderSingh
Copy link

gurjnderSingh commented Apr 30, 2021

When I do zoom in, HeatMap is visible. As soon I started zoon in I am unable to see the color of the Heat Map.

I am using the same code
private var gradientColors = [UIColor.green, UIColor.red]
private var gradientStartPoints = [0.2, 1.0] as [NSNumber]

  mapView.delegate = self
  heatmapLayer = GMUHeatmapTileLayer()
  heatmapLayer.radius = 100
  heatmapLayer.opacity = 0.7
  heatmapLayer.gradient = GMUGradient(colors: gradientColors,
                                        startPoints: gradientStartPoints,
                                        colorMapSize: 156)

My code is same as you provided on Google developer site
Please let me know if anything is misssing
Thanks!

@gurjnderSingh gurjnderSingh added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 30, 2021
@gurjnderSingh
Copy link
Author

Before ZoomIn
CropUploadTeek

After Zoom In
CropWrong

@arriolac
Copy link
Contributor

arriolac commented May 5, 2021

This is perhaps due to the radius size you have set. Based on our docs, the value is recommended to be between 10 and 50. See: https://developers.google.com/maps/documentation/ios-sdk/utility/heatmap#customize-the-heatmap

@gurjnderSingh
Copy link
Author

gurjnderSingh commented May 6, 2021

@arriolac Thanks! for your reply. But radius has no effect on this. I have tried all values from 10-60 for radius, for opacity value 1, and colorMapSize value 256. All these have no effect when I do zoom in. The result is the same as the above ss. Even I tried in the sample GitHub code the result is the same. In Android, the same is working fine i.e I have to do the same.

@gurjnderSingh
Copy link
Author

@arriolac Please help to find the solution.

@gurjnderSingh gurjnderSingh changed the title HeatMap not visible when zoom in. HeatMap not visible when it is zoomed in. Jun 20, 2021
@james-innes
Copy link

Set maxIntensity: 3, as an option of the HeatmapLayer. Before setting this there was just a blur. This map has over ~14k points.

Screenshot 2022-06-13 at 12 51 31 pm

Or where there is a high density of points replace them with one point with a greater weight for performance if you don't require the pin point detail.

@hanandika
Copy link

hanandika commented Dec 1, 2022

Try this


private var gradientColors = [UIColor.green, UIColor.red]
private var gradientStartPoints = [0.05, 0.5] as [NSNumber]
.
.
.
// Set heatmap options.
heatmapLayer = GMUHeatmapTileLayer()
heatmapLayer.radius = 100
heatmapLayer.opacity = 1.0
heatmapLayer.gradient = GMUGradient(colors: gradientColors,
                                  startPoints: gradientStartPoints,
                                  colorMapSize: 256)
heatmapLayer.maximumZoomIntensity = 17
heatmapLayer.minimumZoomIntensity = 10

after that add your lat lng list to weightData

// Add the latlngs to the heatmap layer.
heatmapLayer.weightedData = list

Simulator Screen Shot - iPhone 14 Pro - 2022-12-01 at 13 18 12
Simulator Screen Shot - iPhone 14 Pro - 2022-12-01 at 13 19 42

@Rob-Biemans
Copy link

Set the colorMapSize to 16000 @gurjnderSingh

@iHackSubhodip iHackSubhodip added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Nov 9, 2024
@wangela wangela removed the triage me I really want to be triaged. label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

7 participants