简体   繁体   English

使用 AWS SDK 帮助调用并允许用户在 JavaScript 中创建跟踪器 API?

[英]Using AWS SDK to help call and allow a user create a tracker API in JavaScript?

Ive been trying to create a form where users can provide a name and location then create a tracker, to be used alongside Location Services Maps.我一直在尝试创建一个表单,用户可以在其中提供名称和位置,然后创建一个跟踪器,与位置服务地图一起使用。 I fee like i am close but am not sure why its not working nor rendering.我觉得我很接近但不确定为什么它不起作用或渲染。

在此处输入图像描述

A few initial thoughts based on the code snippet you shared:基于您分享的代码片段的一些初步想法:

  • I don't know enough about your use case, you wouldn't need to have more than one tracker per asset type when tracking moving objects.我对您的用例了解不够,在跟踪移动物体时,您不需要为每种资产类型配备一个以上的跟踪器。 If that's the case for you, create trackers using AWS CLI or AWS Console.如果是这种情况,请使用 AWS CLI 或 AWS 控制台创建跟踪器。
  • If you'd like to create trackers using the JavaScript SDK, first, you need to authenticate your request.如果您想使用 JavaScript SDK 创建跟踪器,首先,您需要验证您的请求。 See Prerequisites for using Amazon Location Service and Geofencing and Tracking to get more information.请参阅使用 Amazon Location Service 的先决条件地理围栏和跟踪以获取更多信息。
  • Check your input parameters ( params ) against the CreateTracker API requirements and make sure you're using the right parameters and passing the right values.根据CreateTracker API要求检查您的输入参数 ( params ),并确保您使用正确的参数并传递正确的值。
  • Check your browser's console and post the errors you're getting here to help me better understand the issue.检查浏览器的控制台并在此处发布您遇到的错误,以帮助我更好地理解问题。
  • Note that createTracker creates a new tracker that does not have any data - this means that there is nothing to render yet.请注意, createTracker创建了一个没有任何数据的新跟踪器 - 这意味着还没有任何内容可渲染。 To track your assets, you'll need to send position updates to the tracker.要跟踪您的资产,您需要向跟踪器发送 position 更新。 See Start Tracking for an example.有关示例,请参见开始跟踪

Share a bit more about your use case, ie, what is it you're trying to do.分享更多关于您的用例的信息,即您想要做什么。 That'll help me better understand the problem.这将帮助我更好地理解问题。

UPDATE: here is what I'd do for your use case:更新:这是我会为您的用例做的事情:

Hope this helps.希望这可以帮助。

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

相关问题 如何允许 aws 编程用户使用承担角色创建资源 - How to allow aws programatic user to create resources using assume role AWS Chime 消息传递:如何使用 JavaScript 将新用户添加到通道 SDK - AWS Chime Messaging: How to add a new user to a channel using the JavaScript SDK AWS API 网关 - 使用 C# 调用 GET 方法 SDK - AWS API Gateway - Call GET Method with C# SDK AWS 允许用户创建不创建其他策略的策略? - AWS allow user to create policies that doesn't create other policies? 使用 Javascript 的 Amplify SDK 为未经授权的用户使用 Cognito 身份池访问 AWS API 网关方法 - Access AWS API Gateway method using Cognito Identity pool for unauthorized users using Amplify SDK for Javascript AWS SCP - 仅允许来自公司 IP 的 API 调用 - AWS SCP - allow API call from company's IPs only 如何在 Javascript 中调用 AWS API Gateway? - How to call AWS API Gateway in Javascript? 为 JavaScript AWS Amplify SDK / React 应用程序中基于 AWS Cognito 的身份验证分离用户池 - Separating user pools for JavaScript AWS Amplify SDK / AWS Cognito based authentication in React app 如何使用 javascript sdk 获取 aws lambda 调用计数 - how to get aws lambda invocation count using javascript sdk 使用 AWS javascript SDK,V3,是否有等效的凭证提供程序链? - Using the AWS javascript SDK, V3, is there a credentials provider chain equivalent?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM