|
1 | 1 | import React from 'react' |
2 | 2 | import { TouchableOpacity, Image, View, Text, Platform, Dimensions, StyleSheet, ScrollView } from 'react-native' |
3 | | -import Marker from 'react-native-image-marker' |
| 3 | +import Marker, { Position, ImageFormat } from 'react-native-image-marker' |
4 | 4 | import Picker from 'react-native-image-picker' |
5 | 5 | const icon = require('./icon.jpeg') |
6 | 6 | // const iconTP = require('./tpimage.png') |
@@ -127,43 +127,43 @@ export default class MarkerTest extends React.Component { |
127 | 127 | </TouchableOpacity> |
128 | 128 | <TouchableOpacity |
129 | 129 | style={s.btn} |
130 | | - onPress={() => this._markByPosition('topLeft')} |
| 130 | + onPress={() => this._markByPosition(Position.topLeft)} |
131 | 131 | > |
132 | 132 | <Text style={s.text} >TopLeft</Text> |
133 | 133 | </TouchableOpacity> |
134 | 134 | <TouchableOpacity |
135 | 135 | style={s.btn} |
136 | | - onPress={() => this._markByPosition('topCenter')} |
| 136 | + onPress={() => this._markByPosition(Position.topCenter)} |
137 | 137 | > |
138 | 138 | <Text style={s.text} >topCenter</Text> |
139 | 139 | </TouchableOpacity> |
140 | 140 | <TouchableOpacity |
141 | 141 | style={s.btn} |
142 | | - onPress={() => this._markByPosition('topRight')} |
| 142 | + onPress={() => this._markByPosition(Position.topRight)} |
143 | 143 | > |
144 | 144 | <Text style={s.text} >topRight</Text> |
145 | 145 | </TouchableOpacity> |
146 | 146 | <TouchableOpacity |
147 | 147 | style={s.btn} |
148 | | - onPress={() => this._markByPosition('center')} |
| 148 | + onPress={() => this._markByPosition(Position.center)} |
149 | 149 | > |
150 | 150 | <Text style={s.text} >Center</Text> |
151 | 151 | </TouchableOpacity> |
152 | 152 | <TouchableOpacity |
153 | 153 | style={s.btn} |
154 | | - onPress={() => this._markByPosition('bottomLeft')} |
| 154 | + onPress={() => this._markByPosition(Position.bottomLeft)} |
155 | 155 | > |
156 | 156 | <Text style={s.text} >bottomLeft</Text> |
157 | 157 | </TouchableOpacity> |
158 | 158 | <TouchableOpacity |
159 | 159 | style={s.btn} |
160 | | - onPress={() => this._markByPosition('bottomCenter')} |
| 160 | + onPress={() => this._markByPosition(Position.bottomCenter)} |
161 | 161 | > |
162 | 162 | <Text style={s.text} >bottomCenter</Text> |
163 | 163 | </TouchableOpacity> |
164 | 164 | <TouchableOpacity |
165 | 165 | style={s.btn} |
166 | | - onPress={() => this._markByPosition('bottomRight')} |
| 166 | + onPress={() => this._markByPosition(Position.bottomRight)} |
167 | 167 | > |
168 | 168 | <Text style={s.text} >bottomRight</Text> |
169 | 169 | </TouchableOpacity> |
@@ -233,7 +233,7 @@ export default class MarkerTest extends React.Component { |
233 | 233 | scale: 1, |
234 | 234 | markerScale: 1, |
235 | 235 | quality: 100, |
236 | | - saveFormat: 'jpg' |
| 236 | + saveFormat: ImageFormat.jpg |
237 | 237 | }).then((path) => { |
238 | 238 | console.log('====================================') |
239 | 239 | console.log(path) |
|
0 commit comments