Fork me on GitHub
#cljsrn
<
2019-06-13
>
worlds-endless21:06:13

react-native-maps: am I misunderstanding how to translate https://github.com/react-native-community/react-native-maps#mapview once I've got the dependencdies all figured out?

worlds-endless21:06:28

Trying to get react-native-maps to work

worlds-endless23:06:23

So basically, I can't get myself a MapView (https://github.com/react-native-community/react-native-maps/blob/master/docs/mapview.md). I've tried re-natal require react-native-map/MapView, trying to get (.-MapView react-native-map), and others, and just can't find the MapView

joshmiller23:06:34

@worlds-endless I am using react-native-maps, let me check to see how I have it set up

joshmiller23:06:31

So my map-view is

(def react-native-maps (js/require "react-native-maps"))
(def map-view (r/adapt-react-class (.-default react-native-maps)))

joshmiller23:06:43

I think that’s the difference there

worlds-endless23:06:10

I saw that default and was wondering about that. So you don't have "map-view" or any such thing included as a component in your .renatal file?

joshmiller23:06:26

You still need that

joshmiller23:06:44

It’s in my modules array in .re-natal

joshmiller23:06:26

Which puts it into index.js when you run re-natal use-figwheel

worlds-endless23:06:51

strange... when I try to include "react-native-maps/MapView" in my deps, react-native can't compile

joshmiller23:06:09

Which deps are you talking about?

worlds-endless23:06:32

.renatal modules

joshmiller23:06:52

I just have "react-native-maps"

worlds-endless23:06:09

ok; so you don't have to add it as a sub-component

joshmiller23:06:19

On the version I’m on at least, no

joshmiller23:06:37

0.21.0 for reference

worlds-endless23:06:43

Ok; compiler isn't failing now. May I ask what your [map-view ...] call looks like?

worlds-endless23:06:00

Is it just a {} as an arg, or do you need clj->js?

joshmiller23:06:06

[map-view {:style {:flex 1}
                       :shows-user-location true
                       :map-type "mutedStandard"
                       :region {:latitude (:loc/lat @location)
                                :longitude (:loc/lon @location)
                                :latitudeDelta 0.09
                                :longitudeDelta 0.04}}
               ;;; ...
              ]