React-native-mapbox-gl: v6 Custom images as annotations?

Created on 13 Nov 2017  路  3Comments  路  Source: nitaliano/react-native-mapbox-gl

Hi!
Thanks for updating this library. I hope we will get a stadier stream of updates going forward now.
And that MapBox will start to officially support this package. That would be great! 馃帀 .

In < v6 you could have custom images over annotations, is this supported in v6?
If not, I would like to to a feature request!

Thanks

Most helpful comment

You can put an object image inside a PointAnnotation, like this:

        <Mapbox.PointAnnotation
              key={id}
              id={id}
              title={name}
              anchor={{ x: 0.5, y: 1 }}
              coordinate={[location.longitude, location.latitude]}>
              <Image source={{uri: icon}}  style={{width: width, height: height}}/>
        </Mapbox.PointAnnotation>

All 3 comments

You can put an object image inside a PointAnnotation, like this:

        <Mapbox.PointAnnotation
              key={id}
              id={id}
              title={name}
              anchor={{ x: 0.5, y: 1 }}
              coordinate={[location.longitude, location.latitude]}>
              <Image source={{uri: icon}}  style={{width: width, height: height}}/>
        </Mapbox.PointAnnotation>

Yup what @devstepbcn mentioned is the correct way of handling it.

Thanks. Works!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vyankat70war picture vyankat70war  路  3Comments

madroneropaulo picture madroneropaulo  路  4Comments

lernerbot picture lernerbot  路  3Comments

max-prokopenko picture max-prokopenko  路  4Comments

Maxence-Machu picture Maxence-Machu  路  3Comments