This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create a map with a marker. | |
* Creating or dragging the marker sets the latitude and longitude values | |
* in the input fields. | |
*/ | |
// We'll insert the map after this element: | |
var prev_el_selector = '.fieldWrapper#field-id_longitude'; | |
// The input elements we'll put lat/lon into and use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getURLFromCDN = (imageURL, height, quality) => { | |
// url formatting depend on CDN | |
return `${CDNimagePath}/${imageURL}?height=${Math.round(height)}&format=jpg&q=${quality}`; | |
}; | |
// render | |
<FastImage | |
source={{ uri: getURLFromCDN("https://url/image.png", 200, 80) }} // https://cdnurl/https://url/image.png?height=200&q=80&format=jpg | |
style={imgStyle} | |
/> |