react-native-maps icon indicating copy to clipboard operation
react-native-maps copied to clipboard

Android POIs not visible

Open saransh-malik opened this issue 1 year ago • 10 comments

Summary

We didn't do any change to the library in our production app and all of a sudden certain POIs like hospitals, restuarants are all gone but only from android app, iOS app shows them just fine. Any idea what has changed and what we are missing?

Reproducible sample code

import MapView, { PROVIDER_GOOGLE } from 'react-native-maps'; // remove PROVIDER_GOOGLE import if not using Google Maps
...
const styles = StyleSheet.create({
 container: {
   ...StyleSheet.absoluteFillObject,
   height: 400,
   width: 400,
   justifyContent: 'flex-end',
   alignItems: 'center',
 },
 map: {
   ...StyleSheet.absoluteFillObject,
 },
});

export default () => (
   <View style={styles.container}>
     <MapView
       provider={PROVIDER_GOOGLE} // remove if not using Google Maps
       style={styles.map}
       region={{
         latitude: 37.78825,
         longitude: -122.4324,
         latitudeDelta: 0.015,
         longitudeDelta: 0.0121,
       }}
     >
     </MapView>
   </View>
);

Steps to reproduce

Just run the app in android

Expected result

See all POIs in the android app and it should match the iOS app.

Actual result

iOS shows more POIs than android app.

React Native Maps Version

1.11.3

What platforms are you seeing the problem on?

Android

React Native Version

0.69

What version of Expo are you using?

Not using Expo

Device(s)

Samsung Galaxy A7 Lite

Additional information

No response

saransh-malik avatar May 28 '24 15:05 saransh-malik

Hi ! Maybe google changed something on their SDK.

You can try to use the prop customMapStyle to manage your poi. Here is a reference to Maps doc.

Here is my customMapStyle to help you :

export const mapStyle = [
  {
    elementType: "labels",
    stylers: [
      {
        visibility: "off",
      },
    ],
  },
  {
    featureType: "administrative",
    stylers: [
      {
        visibility: "on",
      },
    ],
  },
  {
    featureType: "administrative.land_parcel",
    stylers: [
      {
        visibility: "off",
      },
    ],
  },
  {
    featureType: "administrative.neighborhood",
    stylers: [
      {
        visibility: "off",
      },
    ],
  },
  {
    featureType: "landscape",
    stylers: [
      {
        visibility: "on",
      },
    ],
  },
  {
    featureType: "road",
    stylers: [
      {
        visibility: "on",
      },
    ],
  },
];

QuentinGrange avatar Jun 09 '24 14:06 QuentinGrange

I have the same issue. Using Expo SDK 50. Most of the POIs have suddenly disappeared on Android. They did show for some time on the Android emulator but then, as I was further testing and reloading, they showed for 1 sec and got 'hidden'. Now they are missing on the emulator too.

I think Google changed something on their side.

vm02 avatar Jun 17 '24 08:06 vm02

@QuentinGrange That doesn't help. Already tried that. Google has probably changed something and maybe rolling it out slowly. I believe might be part of moving to new cloud based styling

saransh-malik avatar Jun 27 '24 16:06 saransh-malik

@saransh-malik Any news on this? I'm facing the same issue.

On iOS all the POI are shown, but on Android, it's limited to a few (hospitals, monuments) but no stores at all.

reisvini avatar Jul 31 '24 18:07 reisvini

@vm02 did you managed to go bypass this issue?

reisvini avatar Aug 08 '24 04:08 reisvini

@reisvini Unfortunately not yet.

vm02 avatar Aug 08 '24 06:08 vm02

I had to switch over to use the mapId for the map just for android to get the POIs visible again. Probably google is now forcing to use cloud map management. So you would need to add a new "googleMapId" prop to your MapView, just get the id from map management page on maps console of your google account.

saransh-malik avatar Aug 27 '24 11:08 saransh-malik

Hey @saransh-malik, thanks for answering! I'm still having issues related to showing the POIs. Even using cloud map management, setting up to show stores and retailers, and then passing the "googleMapId" to the app, only hospitals, etc are shown, but not stores.

Can you share more details on your environment?

I'm currently using:

  • RN 0.75.2 (Just upgraded from 0.73.2, which was not working too)
  • react-native-maps -> 1.18.0 (latest)
  • New Architecture -> Disabled

reisvini avatar Aug 28 '24 20:08 reisvini

I'm having the same issue on android and using

  • RN 0.75.3
  • React native maps 1.18.0

Also from what i read using a mapID from the cloud will make the loading calls for the map being billed.

DarkSorrow avatar Sep 29 '24 14:09 DarkSorrow

@DarkSorrow

I’m still experiencing issues here.

While the iOS version works fine I’ve encountered persistent problems on Android. I’ve tried updating and downgrading the libraries, and tested on Android versions 12, 13, 14, and 15.

Additionally, I experimented with both including and excluding the mapID, as well as adjusting various style properties, but nothing seems to resolve the issue.

Any insights would be greatly appreciated!

reisvini avatar Sep 30 '24 17:09 reisvini

@reisvini Hey, I didn't do anything special just enabled all POIs in the map management page on google cloud console and increased the POI density to full and then simply used the mapID in my app.

My versions are very similar to yours. Nothing else was changed and I got to see all POIs on the map.

Though would still love to know what exactly is the reason for it, so far unable to find any logic as to why it happened in the first place.

saransh-malik avatar Oct 23 '24 06:10 saransh-malik

@saransh-malik it actually came back on android, i can now see the POI again without using the mapID. But for a few weeks it just completely vanished. I still think the changes is more on google side and the way they are handling their transition with the "old" version

DarkSorrow avatar Nov 06 '24 15:11 DarkSorrow

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If the issue remains relevant, simply comment Still relevant and the issue will remain open. Thank you for your contributions.

github-actions[bot] avatar Feb 05 '25 01:02 github-actions[bot]