nixta / clusterlayer-plugin-ios

A cluster layer extension to the ArcGIS Runtime for iOS
14 stars 6 forks source link

After the change of AGSTiledMapServiceLayer, the cluster is abnormal. #26

Open pengrun opened 6 years ago

pengrun commented 6 years ago

When using "https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" service, the cluster function is normal, but when the "http://www.digitalcq.com/RemoteRest/services/CQMap_IMG/MapServer" service is used, there is always only one point in the cluster.I've been bothering me for a long time.

pengrun commented 6 years ago

And, initialEnv changes to the following: AGSSpatialReference reference = [AGSSpatialReference spatialReferenceWithWKID:4490]; AGSEnvelope initialEnv = [AGSEnvelope envelopeWithXmin:105.3831598117314 ymin:28.897172489811304 xmax:108.13817851680021 ymax:30.46728535770415 spatialReference:reference]; [self.mapView zoomToEnvelope:initialEnv animated:NO];

nixta commented 5 years ago

Yeah. The implementation assumes a Web Mercator tiling scheme. I am working on an update to Runtime 100.x (#22) and will see if I can make it more generic.

In the meantime, just tweaking the grid's cell size might get you better results (it's a completely broken and arbitrary calculation at the moment 😬). See:

https://github.com/nixta/clusterlayer-plugin-ios/blob/0fa0188af535c2cde35431befb2746e77cd50e61/AGSClusterLayer/AGSClusterLayer.m#L629-L632