├── .github
└── workflows
│ └── release.yml
├── .gitignore
├── .idea
├── Mapir-react-native-sdk.iml
├── encodings.xml
├── misc.xml
├── modules.xml
├── vcs.xml
└── workspace.xml
├── LICENSE
├── README.md
├── assets
└── icon.png
├── components
├── Camera.js
├── Images.js
├── RasterLayer.js
├── RasterSource.js
├── SymbolLayer.js
├── UserLocation.js
├── fillLayer.js
├── lineLayer.js
├── marker.js
├── popup.js
└── shapeSource.js
├── package.json
└── src
└── index.js
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | branches:
5 | - master
6 | jobs:
7 | release:
8 | name: Release
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: Checkout 🛎️
12 | uses: actions/checkout@v2
13 | - name: Setup Node.js
14 | uses: actions/setup-node@v1
15 | with:
16 | node-version: 14
17 | - name: Publish 📤
18 | uses: JS-DevTools/npm-publish@v1
19 | with:
20 | token: ${{ secrets.NPM_TOKEN }}
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Node template
3 | # Logs
4 | logs
5 | *.log
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 |
10 | # Runtime data
11 | pids
12 | *.pid
13 | *.seed
14 | *.pid.lock
15 |
16 | # Directory for instrumented libs generated by jscoverage/JSCover
17 | lib-cov
18 |
19 | # Coverage directory used by tools like istanbul
20 | coverage
21 |
22 | # nyc test coverage
23 | .nyc_output
24 |
25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26 | .grunt
27 |
28 | # Bower dependency directory (https://bower.io/)
29 | bower_components
30 |
31 | # node-waf configuration
32 | .lock-wscript
33 |
34 | # Compiled binary addons (https://nodejs.org/api/addons.html)
35 | build/Release
36 |
37 | # Dependency directories
38 | node_modules/
39 | jspm_packages/
40 |
41 | # TypeScript v1 declaration files
42 | typings/
43 |
44 | # Optional npm cache directory
45 | .npm
46 |
47 | # Optional eslint cache
48 | .eslintcache
49 |
50 | # Optional REPL history
51 | .node_repl_history
52 |
53 | # Output of 'npm pack'
54 | *.tgz
55 |
56 | # Yarn Integrity file
57 | .yarn-integrity
58 |
59 | # dotenv environment variables file
60 | .env
61 |
62 | # parcel-bundler cache (https://parceljs.org/)
63 | .cache
64 |
65 | # next.js build output
66 | .next
67 |
68 | # nuxt.js build output
69 | .nuxt
70 |
71 | # vuepress build output
72 | .vuepress/dist
73 |
74 | # Serverless directories
75 | .serverless
76 | node_module/
77 |
--------------------------------------------------------------------------------
/.idea/Mapir-react-native-sdk.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <<<<<<< HEAD
5 |
6 | =======
7 |
8 |
9 |
10 |
11 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | <<<<<<< HEAD
25 |
26 |
27 | =======
28 |
29 |
30 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | <<<<<<< HEAD
51 |
52 | =======
53 |
54 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 | <<<<<<< HEAD
64 |
65 |
66 |
67 |
68 | =======
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 | <<<<<<< HEAD
180 | =======
181 |
182 |
183 |
184 |
185 |
186 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 | <<<<<<< HEAD
204 |
205 |
206 |
207 |
208 |
209 | =======
210 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 | <<<<<<< HEAD
221 | =======
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
250 |
251 |
252 |
253 | 1546955020733
254 |
255 |
256 | 1546955020733
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 | <<<<<<< HEAD
303 |
304 | =======
305 |
306 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
307 |
308 |
309 |
310 |
311 | <<<<<<< HEAD
312 |
313 |
314 |
315 |
316 | =======
317 |
318 |
319 |
320 |
321 |
322 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
323 |
324 |
325 |
326 |
327 |
328 |
329 |
330 |
331 |
332 |
333 |
334 |
335 |
336 |
337 |
338 |
339 |
340 |
341 |
342 |
343 |
344 |
345 | <<<<<<< HEAD
346 | =======
347 |
348 |
349 |
350 |
351 |
352 |
353 |
354 |
355 |
356 |
357 |
358 |
359 |
360 |
361 |
362 |
363 |
364 |
365 |
366 |
367 |
368 |
369 |
370 |
371 |
372 |
373 |
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 |
382 |
383 |
384 |
385 |
386 |
387 |
388 |
389 |
390 |
391 |
392 |
393 |
394 |
395 |
396 |
397 |
398 |
399 |
400 |
401 |
402 |
403 |
404 |
405 |
406 |
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 |
415 |
416 |
417 |
418 |
419 |
420 |
421 |
422 |
423 |
424 |
425 |
426 |
427 |
428 |
429 |
430 |
431 |
432 |
433 |
434 |
435 |
436 |
437 |
438 |
439 |
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 |
448 |
449 |
450 |
451 |
452 |
453 |
454 |
455 |
456 |
457 |
458 |
459 |
460 |
461 |
462 |
463 |
464 |
465 | >>>>>>> 49b2232f754cb9352080c43978f6254263fc0cd0
466 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Shiveh Software Co.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MapirReatNativeSDK
2 | [](https://www.npmjs.com/package/mapir-react-native-sdk)
3 |
4 |
5 |  React Native wrapper for mapbox-gl-js. Expose a bunch of component meant to be simple to use for React Native.
6 |
7 | ## Get API Key
8 | 🔑 You should first get api key from [Map.ir](https://corp.map.ir/registration/)
9 |
10 |
11 | ## Installation
12 |
13 | **Dependencies**
14 |
15 | * [node](https://nodejs.org)
16 | * [npm](https://www.npmjs.com/)
17 | * [React Native](https://facebook.github.io/react-native/) recommended version ^0.62.2
18 |
19 | ```
20 | npm install mapir-react-native-sdk
21 | ```
22 |
23 | ### Platform Specific Installation Guides
24 |
25 | * [Android](https://github.com/map-ir/mapir-mapbox/blob/master/android/install.md)
26 | * [iOS](https://github.com/map-ir/mapir-mapbox/blob/master/ios/install.md)
27 | * [example](https://github.com/map-ir/Mapir-react-native-example)
28 |
29 | ## Quick start
30 |
31 | ### Import module
32 |
33 | ```js
34 | import React, {Component} from 'react';
35 | import { SafeAreaView, StyleSheet, View} from 'react-native';
36 | import Mapir from 'mapir-react-native-sdk'
37 | ```
38 |
39 | ### Generate Component
40 | ```jsx
41 | export default function App() {
42 | onRegionDidChange = (e) => {
43 | console.log('onRegionDidChange', e.geometry.coordinates);
44 | };
45 | return (
46 |
47 |
48 | onRegionDidChange(e)}
51 | style={styles.container}
52 | >
53 |
57 |
58 |
59 |
60 | );
61 | }
62 |
63 | const styles = StyleSheet.create({
64 | container: {
65 | flex: 1,
66 | },
67 | });
68 | ```
69 |
70 | 📖 [English Documentation](https://github.com/map-ir/mapir-react-native-sdk/wiki/Documentation)
71 |
72 | 📖 [Persian Documentation](https://support.map.ir/developers/reactnative/)
73 |
--------------------------------------------------------------------------------
/assets/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/map-ir/mapir-react-native-sdk/c4ae382eaa40aa0a27dea7816a68b2bd97d8233c/assets/icon.png
--------------------------------------------------------------------------------
/components/Camera.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class Camera extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default Camera;
16 |
--------------------------------------------------------------------------------
/components/Images.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class Images extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default Images;
16 |
--------------------------------------------------------------------------------
/components/RasterLayer.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class RasterLayer extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default RasterLayer;
16 |
--------------------------------------------------------------------------------
/components/RasterSource.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 | import axios from 'axios';
5 |
6 | class RasterSource extends Component {
7 | static propTypes = {
8 | apiKey: PropTypes.string.isRequired,
9 | };
10 |
11 | constructor(props) {
12 | super(props);
13 | }
14 |
15 | componentDidMount() {
16 | axios({
17 | method: 'GET',
18 | url: `https://map.ir/shiveh/load?x-api-key=${this.props.apiKey}`,
19 | })
20 | .then(function (res) {})
21 | .catch(function (err) {});
22 | }
23 |
24 | render() {
25 | return (
26 |
34 | );
35 | }
36 | }
37 |
38 | export default RasterSource;
39 |
--------------------------------------------------------------------------------
/components/SymbolLayer.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class SymbolLayer extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default SymbolLayer;
16 |
--------------------------------------------------------------------------------
/components/UserLocation.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class UserLocation extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default UserLocation;
16 |
--------------------------------------------------------------------------------
/components/fillLayer.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class FillLayer extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default FillLayer;
16 |
--------------------------------------------------------------------------------
/components/lineLayer.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class LineLayer extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default LineLayer;
16 |
--------------------------------------------------------------------------------
/components/marker.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class Marker extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default Marker;
16 |
--------------------------------------------------------------------------------
/components/popup.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class Popup extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default Popup;
16 |
--------------------------------------------------------------------------------
/components/shapeSource.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import PropTypes from 'prop-types';
4 |
5 | class ShapeSource extends Component {
6 | constructor(props) {
7 | super(props);
8 | }
9 |
10 | render() {
11 | return ;
12 | }
13 | }
14 |
15 | export default ShapeSource;
16 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mapir-react-native-sdk",
3 | "version": "2.2.4",
4 | "main": "src/index.js",
5 | "_phantomChildren": {
6 | "@babel/core": "7.2.2",
7 | "@babel/generator": "7.2.2",
8 | "@babel/helper-module-imports": "7.0.0",
9 | "@babel/parser": "7.2.3",
10 | "@babel/plugin-external-helpers": "7.2.0",
11 | "@babel/plugin-proposal-class-properties": "7.2.3",
12 | "@babel/plugin-proposal-export-default-from": "7.2.0",
13 | "@babel/plugin-proposal-nullish-coalescing-operator": "7.2.0",
14 | "@babel/plugin-proposal-object-rest-spread": "7.2.0",
15 | "@babel/plugin-proposal-optional-catch-binding": "7.2.0",
16 | "@babel/plugin-proposal-optional-chaining": "7.2.0",
17 | "@babel/plugin-syntax-class-properties": "7.2.0",
18 | "@babel/plugin-syntax-dynamic-import": "7.2.0",
19 | "@babel/plugin-syntax-export-default-from": "7.2.0",
20 | "@babel/plugin-syntax-flow": "7.2.0",
21 | "@babel/plugin-syntax-jsx": "7.2.0",
22 | "@babel/plugin-syntax-object-rest-spread": "7.2.0",
23 | "@babel/plugin-transform-arrow-functions": "7.2.0",
24 | "@babel/plugin-transform-async-to-generator": "7.2.0",
25 | "@babel/plugin-transform-block-scoped-functions": "7.2.0",
26 | "@babel/plugin-transform-block-scoping": "7.2.0",
27 | "@babel/plugin-transform-classes": "7.2.2",
28 | "@babel/plugin-transform-computed-properties": "7.2.0",
29 | "@babel/plugin-transform-destructuring": "7.2.0",
30 | "@babel/plugin-transform-exponentiation-operator": "7.2.0",
31 | "@babel/plugin-transform-flow-strip-types": "7.2.3",
32 | "@babel/plugin-transform-for-of": "7.2.0",
33 | "@babel/plugin-transform-function-name": "7.2.0",
34 | "@babel/plugin-transform-literals": "7.2.0",
35 | "@babel/plugin-transform-member-expression-literals": "7.2.0",
36 | "@babel/plugin-transform-modules-commonjs": "7.2.0",
37 | "@babel/plugin-transform-object-assign": "7.2.0",
38 | "@babel/plugin-transform-object-super": "7.2.0",
39 | "@babel/plugin-transform-parameters": "7.2.0",
40 | "@babel/plugin-transform-property-literals": "7.2.0",
41 | "@babel/plugin-transform-react-display-name": "7.2.0",
42 | "@babel/plugin-transform-react-jsx": "7.2.0",
43 | "@babel/plugin-transform-react-jsx-source": "7.2.0",
44 | "@babel/plugin-transform-regenerator": "7.0.0",
45 | "@babel/plugin-transform-runtime": "7.2.0",
46 | "@babel/plugin-transform-shorthand-properties": "7.2.0",
47 | "@babel/plugin-transform-spread": "7.2.2",
48 | "@babel/plugin-transform-sticky-regex": "7.2.0",
49 | "@babel/plugin-transform-template-literals": "7.2.0",
50 | "@babel/plugin-transform-typescript": "7.2.0",
51 | "@babel/plugin-transform-unicode-regex": "7.2.0",
52 | "@babel/register": "7.0.0",
53 | "@babel/runtime": "7.0.0-beta.55",
54 | "@babel/template": "7.2.2",
55 | "@babel/traverse": "7.2.3",
56 | "@babel/types": "7.2.2",
57 | "absolute-path": "0.0.0",
58 | "ansi-colors": "1.1.0",
59 | "ansi-styles": "3.2.1",
60 | "art": "0.10.3",
61 | "async": "2.6.1",
62 | "async-limiter": "1.0.0",
63 | "base64-js": "1.3.0",
64 | "chalk": "1.1.3",
65 | "commander": "2.19.0",
66 | "compression": "1.7.3",
67 | "concat-stream": "1.6.2",
68 | "connect": "3.6.6",
69 | "core-js": "2.6.1",
70 | "cosmiconfig": "5.0.7",
71 | "create-react-class": "15.6.3",
72 | "debug": "2.6.9",
73 | "denodeify": "1.2.1",
74 | "envinfo": "5.12.1",
75 | "errorhandler": "1.5.0",
76 | "escape-string-regexp": "1.0.5",
77 | "event-target-shim": "1.1.1",
78 | "eventemitter3": "3.1.0",
79 | "fancy-log": "1.3.3",
80 | "fbjs-css-vars": "1.0.2",
81 | "fs-extra": "1.0.0",
82 | "glob": "7.1.3",
83 | "graceful-fs": "4.1.15",
84 | "image-size": "0.6.3",
85 | "inquirer": "3.3.0",
86 | "isomorphic-fetch": "2.2.1",
87 | "jest-docblock": "23.2.0",
88 | "jest-haste-map": "23.5.0",
89 | "jest-serializer": "23.0.1",
90 | "jest-worker": "23.2.0",
91 | "json-stable-stringify": "1.0.1",
92 | "lodash": "4.17.11",
93 | "lodash.throttle": "4.1.1",
94 | "loose-envify": "1.4.0",
95 | "lru-cache": "4.1.5",
96 | "merge-stream": "1.0.1",
97 | "mime": "1.6.0",
98 | "minimist": "1.2.0",
99 | "mkdirp": "0.5.1",
100 | "morgan": "1.9.1",
101 | "node-fetch": "2.3.0",
102 | "node-notifier": "5.3.0",
103 | "npmlog": "2.0.4",
104 | "nullthrows": "1.1.1",
105 | "object-assign": "4.1.1",
106 | "opn": "3.0.3",
107 | "optimist": "0.6.1",
108 | "plist": "3.0.1",
109 | "plugin-error": "0.1.2",
110 | "promise": "7.3.1",
111 | "prop-types": "15.6.2",
112 | "react-clone-referenced-element": "1.1.0",
113 | "react-timer-mixin": "0.13.4",
114 | "react-transform-hmr": "1.0.4",
115 | "regenerator-runtime": "0.11.1",
116 | "resolve": "1.9.0",
117 | "rimraf": "2.6.2",
118 | "safe-buffer": "5.1.2",
119 | "scheduler": "0.12.0",
120 | "semver": "5.6.0",
121 | "serialize-error": "2.1.0",
122 | "serve-static": "1.13.2",
123 | "setimmediate": "1.0.5",
124 | "shebang-command": "1.2.0",
125 | "shell-quote": "1.6.1",
126 | "simple-plist": "0.2.1",
127 | "source-map": "0.5.7",
128 | "stacktrace-parser": "0.1.4",
129 | "temp": "0.8.3",
130 | "throat": "4.1.0",
131 | "through2": "2.0.5",
132 | "ua-parser-js": "0.7.19",
133 | "uglify-es": "3.3.9",
134 | "which": "1.3.1",
135 | "wordwrap": "1.0.0",
136 | "write-file-atomic": "1.3.4",
137 | "ws": "1.1.5",
138 | "xmldoc": "0.4.0",
139 | "xpipe": "1.0.5",
140 | "yargs": "9.0.1",
141 | "prop-types": "15.6.2",
142 | "axios": "^0.19.2"
143 | },
144 | "_requested": {
145 | "type": "tag",
146 | "registry": true,
147 | "raw": "mapir-react-native-sdk",
148 | "name": "mapir-react-native-sdk",
149 | "rawSpec": "",
150 | "saveSpec": null,
151 | "fetchSpec": "latest"
152 | },
153 | "_requiredBy": [
154 | "#USER",
155 | "/"
156 | ],
157 | "author": "reyhane masumi ",
158 | "bundleDependencies": false,
159 | "dependencies": {
160 | "mapir-mapbox": "2.0.6",
161 | "axios": "^0.19.2"
162 | },
163 | "deprecated": false,
164 | "devDependencies": {
165 | "cross-env": "^5.1.3",
166 | "eslint": "^4.16.0",
167 | "eslint-config-airbnb": "^16.1.0",
168 | "eslint-plugin-import": "^2.7.0",
169 | "eslint-plugin-jsx-a11y": "^6.0.2",
170 | "eslint-plugin-react": "^7.4.0",
171 | "istanbul": "^1.0.0-alpha"
172 | },
173 | "files": [
174 | "src",
175 | "components",
176 | "assets"
177 | ],
178 | "keywords": [
179 | "mapir",
180 | "react",
181 | "npm",
182 | "module",
183 | "node",
184 | "javascript",
185 | "mapir"
186 | ],
187 | "license": "MIT",
188 | "repository": {
189 | "type": "git",
190 | "url": "git+https://github.com/map-ir/mapir-react-native-sdk"
191 | },
192 | "scripts": {
193 | "lint": "eslint src test"
194 | },
195 | "description": ""
196 | }
197 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import Mapbox from 'mapir-mapbox';
3 | import { Platform, View } from 'react-native';
4 | import PropTypes from 'prop-types';
5 | import axios from 'axios';
6 | import Marker from './../components/marker';
7 | import ShapeSource from './../components/shapeSource';
8 | import LineLayer from './../components/lineLayer';
9 | import RasterSource from './../components/RasterSource';
10 | import RasterLayer from './../components/RasterLayer';
11 | import Popup from './../components/popup';
12 | import Camera from './../components/Camera';
13 | import SymbolLayer from './../components/SymbolLayer';
14 | import UserLocation from './../components/UserLocation';
15 | import Images from './../components/Images';
16 | import FillLayer from './../components/fillLayer';
17 |
18 | const instructions = Platform.select({
19 | ios: true,
20 | android: false,
21 | });
22 |
23 | class Mapir extends Component {
24 | static propTypes = {
25 | apiKey: PropTypes.string.isRequired,
26 | };
27 |
28 | constructor(props) {
29 | super(props);
30 | }
31 |
32 | componentDidMount() {
33 | axios({
34 | method: 'GET',
35 | url: `https://map.ir/vector/load?x-api-key=${this.props.apiKey}`,
36 | })
37 | .then(function (res) {})
38 | .catch(function (err) {});
39 | }
40 |
41 | render() {
42 | if (Platform.OS === 'android') {
43 | Mapbox.apiKey(this.props.apiKey);
44 | }
45 | return (
46 |
52 | );
53 | }
54 | }
55 |
56 | Mapir.Marker = Marker;
57 | Mapir.ShapeSource = ShapeSource;
58 | Mapir.LineLayer = LineLayer;
59 | Mapir.RasterSource = RasterSource;
60 | Mapir.RasterLayer = RasterLayer;
61 | Mapir.Popup = Popup;
62 | Mapir.Camera = Camera;
63 | Mapir.SymbolLayer = SymbolLayer;
64 | Mapir.UserLocation = UserLocation;
65 | Mapir.Images = Images;
66 | Mapir.FillLayer = FillLayer;
67 |
68 | export default Mapir;
69 |
--------------------------------------------------------------------------------