简体   繁体   English

React Native Maps 价格

[英]React Native Maps Price

I am making an app using react native and I want to implement a map using react-native-maps library MapView.我正在使用 react native 制作应用程序,我想使用 react-native-maps 库 MapView 实现 map。

The application will use the map to display markers on it for users using signals to share it with multiple users.该应用程序将使用 map 在其上显示标记,供用户使用信号与多个用户共享。

I don't want a dynamic map or something just tiles.我不想要动态 map 或只是瓷砖的东西。

I don't understand how pricing works, I read some people say it's free others say it's not.我不明白定价是如何运作的,我读到有些人说它是免费的,而另一些人则说它不是。

I would like some explanation on how MapView works in real application with a large number of users.我想解释一下 MapView 如何在具有大量用户的实际应用程序中工作。

import { StyleSheet, Text, View, Button } from "react-native";
import MapView, {
  PROVIDER_GOOGLE,
  MAP_TYPES,
  PROVIDER_DEFAULT,
  UrlTile,
  Marker,
} from "react-native-maps";
import React from "react";

export default function Home({ navigation }) {
  let location = {
    latitude: 23.259933,
    longitude: 77.412613,
    latitudeDelta: 0.009,
    longitudeDelta: 0.009,
  };

  return (
    <View style={styles.container}>
      <View style={styles.myMap}>
        {/* <MapView
          style={StyleSheet.absoluteFillObject}
          provider={PROVIDER_GOOGLE}
          mapType="hybrid"
          region={location}
        /> */}
        <MapView
          region={location}
          provider={null}
          mapType={MAP_TYPES.HYBRID}
          rotateEnabled={false}
          style={{ flex: 1 }}
          style={styles.map}
          showsUserLocation
        >
          {/* <UrlTile
            urlTemplate="http://a.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png"
            maximumZ={19}
          /> */}
          <Marker
            title="Home"
            coordinate={{
              latitude: location.latitude,
              longitude: location.longitude,
            }}
          />
        </MapView>
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#ffd",
    alignItems: "center",
    justifyContent: "center",
  },
  myMap: {
    flex: 2,
    backgroundColor: "white",
    width: "100%",
    marginTop: 30,
    marginBottom: 30,
  },
  map: {
    width: "100%",
    height: "100%",
  },

});

Open street map managed host is free and support only iOS with react-native-maps , It's not recommended for large scale app, when happen, you need to host map tiles on your own servers, Open street map 托管主机是免费的,仅支持带有react-native-maps的 iOS ,不建议用于大型应用程序,如果发生这种情况,您需要在自己的服务器上托管 map 磁贴,

Google maps are cross-platform and performant but let's examine their pricing.谷歌地图是跨平台和高性能的,但让我们来看看他们的定价。

Google map bill client per request, in React Native context, when a user navigates to screen with a map inside, Map SDK query google server and render the map, this count as a single request. Google map bill client per request, in React Native context, when a user navigates to screen with a map inside, Map SDK query google server and render the map, this count as a single request.

Rendering markers or other UI elements have no impact on map requests and Google will not bill for that.渲染标记或其他 UI 元素对 map 请求没有影响,Google 不会为此收费。

Zoom and pan are not counted as requests and will not impact your billing invoice.缩放和平移不计为请求,不会影响您的帐单。

Technically, you can be billed for a single server request and a user continues to use the map-based features.从技术上讲,您可以为单个服务器请求付费,并且用户继续使用基于地图的功能。

If you're building an uber-like app with turn-to-turn navigation with continuous server requests, pricing will be huge.如果您正在构建一个类似 uber 的应用程序,该应用程序具有转弯导航和持续的服务器请求,那么定价将是巨大的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM