1.0.12 • Published 11 months ago

react-native-openstreetmap-search-places v1.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

OpenStreetMapSearchPlace

NPM version NPM downloads

A React Native component to search places using OpenStreetMap

Demo

Requirements

node v20.13.1

Installation

npm install react-native-openstreetmap-search-places
yarn add react-native-openstreetmap-search-places

Usage

import {useState} from 'react'
import {OpenStreetMapSearchPlace, LocationType} from 'react-native-openstreetmap-search-places'

const MyComponent = () => {
    const [location, setLocation] = useState<LocationType | undefined>(undefined)

    return (
        <OpenStreetMapSearchPlace
            location={location}
            setLocation={setLocation}
            lang='en'
            noResultFoundText='No result found'
            placeHolder='Search place'
            searchPlaceHolder='Enter address'
            mode='outlined'
            style={{
                height: 61, 
                backgroundColor: '#C7E9FD'
            }}
            contentStyle={{fontFamily: 'Roboto'}}
            outlineStyle={{
                borderRadius: 14, 
                borderWidth: 0, 
                marginHorizontal: 2
            }}
            searchBarStyle={{
                backgroundColor: '#C7E9FD',
                borderRadius: 12,
                borderWidth: 0,
                marginTop: 2,
            }}
            searchBarInputStyle={{fontFamily: 'Roboto'}}
            searchResultLabelStyle={{fontSize: 14}}
            modalStyle={{borderRadius: 14}}
            loaderColor='blue'
            loaderSize='small'
            modalBgColor='white'
            dismissable
        />
    )
}

export default MyComponent

Props

PropertyTypeRequiredDescription
locationLocationTypeTrueLocation data of searched value
setLocationfunctionTrueSet location value of searched value
langStringFalseLanguage used to search places (default en)
noResultFoundTextStringFalseText to display when no result found
placeHolderStringFalseInput text component placeholder
searchPlaceHolderStringFalseSearch input text placeholder
modeStringTrueText input style display (eg: outlined or flat)
styleStylePropFalseInput text component style
contentStyleStylePropFalseInput text component content style
outlineStyleStylePropFalseInput text component outline style
searchBarStyleStylePropFalseSearch bar component style
searchBarInputStyleStylePropFalseSearch input text component style
searchResultLabelStyleStylePropFalseSearch result label style
modalStyleStylePropFalseSearch results modal custom style
loaderColorStringFalseLoader color (default blue)
loaderSizeString or NumberTrueLoader size (eg: 12, small or large)
loaderColorStringTrueLoader color
modalBgColorStringTrueModal background color
dismissableBooleanTrueSet if modal dismissable
iconStringFalseInput text component left icon. (See icons list)
iconSizeNumberFalseInput text component left icon size

License

The MIT License (MIT). Please see License File for more information.

Changelog

Please see CHANGELOG for more information what has changed recently.

1.0.11

1 year ago

1.0.10

1 year ago

1.0.12

11 months ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago