react-native map定制的css或style

时间:2016-09-04 02:54:58

标签: javascript react-native maps

有没有办法像常规javascript一样自定义MapView?我想做一个这样的主题:file:///Users/robertkelly/Downloads/snazzy-maps-example-ultra-light-with-labels-style.html

我可以在vanilla javascript中使用它:http://jsbin.com/fodapo/edit?js,output

但似乎无法弄清楚如何在React-Native中实现这一点,因为没有标准的google maps api为mapview提供输入,如:

[{"featureType":"water","elementType":"geometry","stylers":[{"color":"#e9e9e9"},{"lightness":17}]},{"featureType":"landscape","elementType":"geometry","stylers":[{"color":"#f5f5f5"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry.fill","stylers":[{"color":"#ffffff"},{"lightness":17}]}]

1 个答案:

答案 0 :(得分:1)

我还不知道设置RN内置MapView的样式的方法,但我认为定义自定义地图样式的可能性很好,应该可以添加到{{3} }。

同时你应该看一下react native productpains组件(android / ios)。您可以使用Mapbox Studio react-native-mapbox-gl创建add a custom map stylereact-native-mapbox-gl