Comments (4)
@nitisha1 I to am facing similar kind of problem #40
from google-maps-ios-utils.
@yadavanand
well,i just added self.view = gmsmapView
but it is not the acceptable solution i guess atleast in my case.it is because of delegate i found and update my code.
` //[THis method contains Show Google Map Logic for the properties! that are synch]
func loadGoogleMap(){
dispatch_async(dispatch_get_main_queue()) {
print(" GOOGLE \(self.googleMapView)")
if(self.googleMapView != nil){
self.clearMap()
self.googleMapView!.clear()
self.googleMapView.clearsContextBeforeDrawing = true
let path = GMSMutablePath()
var count = 0
self.delay(seconds: 0.1) { () -> () in
count = 0
for Prop : Property in self.properties!
{
if Prop.propLat != ""
{
let latStr = Prop.propLat
let latDbl : Double = Double(latStr.floatValue)
let langStr = Prop.propLang as NSString
let langDbl : Double = Double(langStr.floatValue)
path.addCoordinate(CLLocationCoordinate2DMake(langDbl,latDbl))
if(count == 0)
{
// Set up the cluster manager with default icon generator and renderer.
let iconGenerator = GMUDefaultClusterIconGenerator()
let algorithm = GMUNonHierarchicalDistanceBasedAlgorithm()
// let renderer1 = MyCustomRenderer(mapView: self.googleMapView, clusterIconGenerator: iconGenerator)
let renderer = GMUDefaultClusterRenderer(mapView: self.googleMapView!, clusterIconGenerator: iconGenerator)
self.clusterManager = GMUClusterManager(map: self.googleMapView!, algorithm: algorithm, renderer: renderer)
}
let marker:GMSMarker = GMSMarker()
marker.position = CLLocationCoordinate2DMake(langDbl,latDbl)
marker.appearAnimation = kGMSMarkerAnimationPop
marker.title = Prop.propBuildingName as String
marker.snippet = Prop.propCode as String
// marker.infoWindowAnchor = CGPointMake(0.44, 0.45)
let markerIcon:UIImage = self.generateSpot(Prop)
marker.icon = markerIcon
//marker.map = self.googleMapView
self.markersArray!.append(marker)
let spotObje:Spot = Spot()
spotObje.location = marker.position
spotObje.marker = marker
self.clusterManager.addItem(spotObje)
}
count = count+1
}
let bounds = GMSCoordinateBounds(path: path)
if(self.googleMapView != nil)
{
// transaction animaton inreases memory usage
CATransaction.begin()
CATransaction.setValue(NSNumber(float: 3.0), forKey: kCATransactionAnimationDuration)
self.googleMapView!.animateWithCameraUpdate(GMSCameraUpdate.fitBounds(bounds, withPadding: 200.0))
CATransaction.commit()
self.googleMapView.delegate = self
// Call cluster() after items have been added to perform the clustering and rendering on map.
if(self.clusterManager != nil)
{
self.clusterManager.cluster()
// Register self to listen to both GMUClusterManagerDelegate and GMSMapViewDelegate events.
self.clusterManager.setDelegate(self, mapDelegate: self)
}
}
}
}
}
}`
from google-maps-ios-utils.
Can you please attach a screenshot? How many items are there in self. properties? How is it populated?
Can you do a pod try Google-Maps-iOS-Utils
and select the Swift demo app to see if it works for you and take it from there?
Alternatively if there is a git repo for me to take a look it would be easier for me but I understand that it may not be possible.
Unrelated but I do not think you need the create a marker for each spotObje. The ClusterManager will take care of creating the marker for you.
from google-maps-ios-utils.
Closing this out as stale. If this is still an issue, please re-open this issue with a link to a minimal reproduction case in a GitHub repository. Thanks!
from google-maps-ios-utils.
Related Issues (20)
- Equivalent of MultiPoint, MultiLineString, MultiPolygon HOT 2
- Question. How to set background color and text style in icon generator?
- Update documentation to use latest version of Maps SDK for iOS HOT 1
- Impossible to add GoogleMaps & GooglePlaces to project using Carthage HOT 2
- IconGenerator Text Color is always white HOT 2
- Failed to build module 'GoogleMapsUtils' HOT 4
- Unit tests workflow depends on Carthage
- map flickering issue HOT 1
- No such module HOT 1
- [Question] Will you release e.g. 4.2.0 on cocoapods with latest commit regarding Apple Silicon support? HOT 11
- Warning: Error creating LLDB target at path HOT 2
- The automated release is failing 🚨 HOT 1
- snippet-bot full scan
- 4.2.0 version not building cause of missing xframework file HOT 2
- SPM error cannot resolve it. HOT 2
- Clustering: add setter for clusterDistancePoints in the GMUNonHierarchicalDistanceBasedAlgorithm.m HOT 1
- Clustering : Cluster Markers do not initially hide their items on the map HOT 1
- 4.2.2 does not allow updating to latest GoogleMaps (8.x) HOT 6
- TipKit: when adding popover tip to some view on top of GMSMapView tip starts flickering on every map move HOT 1
- Google maps utils compiler error in new Xcode Version 15.0.1 HOT 38
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-maps-ios-utils.