map-ir / mapir-react-native-sdk

MIT License
14 stars 3 forks source link

how can set custom marker on map #5

Closed mojtabadarzi closed 5 years ago

hamid commented 5 years ago

You could add children in Mapir.Marker and put <Image/> <Text> , like following :

 <Mapir.Marker
                            id={'1'}
                            key={1}
                            title="فروشگاه"
                            snippet="توضیحات"
                            selected={true}
                            coordinate={[51.678577, 32.650058,]}
                        >
                                    <Text>custom maker text !</Text>
  </Mapir.Marker>
ReyhaneMasumi commented 5 years ago

https://github.com/map-ir/mapir-mapbox/blob/master/docs/PointAnnotation.md this is our documentation for marker!

h2soheili commented 5 years ago

migrate to ShapeSource and SymbolLayer and mapbox api 7

PointAnnotation laggy on changing map cords

mojtabadarzi commented 3 years ago

how can set custom icon ?

ReyhaneMasumi commented 3 years ago

how can set custom icon?

Do you try this?

<Mapir.Marker coordinate={{ latitude, longitude }}>
    <View>
      <Image
        style={{ width: 100, height: 42 }}
        source={{ uri: 'https://some_image_url...' }}
      />
      <Text>
        {title}
      </Text>
    </View>
  </Mapir.Marker>
mojtabadarzi commented 3 years ago

yes ,i set a png image but its not work for me !!