react-native-map-clustering icon indicating copy to clipboard operation
react-native-map-clustering copied to clipboard

Clusters not exploding and markers not rendering until map interaction

Open evanlarkin10 opened this issue 5 years ago • 2 comments

I am having an issue when pressing a cluster. It normally doesn't explode when you press it and it zooms in. Once you interact with the map (pan or zoom slightly ) it updates and either explodes the cluster or renders the map markers. I am using custom markers and the default cluster icon. ezgif com-gif-maker

<MapView
            ref={mapRef}
            maxZoomLevel={18}
            minZoomLevel={8}
            onPress={() => Keyboard.dismiss()}
            style={styles.mapStyle}
            provider={PROVIDER_GOOGLE}
            clusterTextColor={'#000000'}
            initialRegion={{
              latitude: location.latitude,
              longitude: location.longitude,
              latitudeDelta: location.latitudeDelta,
              longitudeDelta: location.longitudeDelta,
            }}
            onRegionChange={onRegionChange}
          >
            {markers.map((marker) => (
              <Marker
                key={marker.id}
                coordinate={{
                  latitude: parseFloat(marker.lat),
                  longitude: parseFloat(marker.lng),
                }}
                zIndex={getMarkerIndex(marker)}
                title={marker.name}
                onPress={async () => {
                  handlePress()
                }}
              >
                <Image
                  source={getMarkerImage(marker)}
                  resizeMode={'contain'}
                  style={{ height: 45, width: 45 }}
                />
              </Marker>
            ))}
          </MapView>

evanlarkin10 avatar Nov 21 '20 19:11 evanlarkin10

I'm seeing a similar issue, when the map region is changed and markers have been loaded from a REST api, the markers does not appear until one taps on the map.

@venits Any idea what could be wrong?

Ben305 avatar Mar 21 '21 10:03 Ben305

i have the same issue, it's solved when I put tracksViewChanges=true in Marker property

AsServices avatar Jan 31 '22 10:01 AsServices