简体   繁体   English

如何在C#中使用Google API向Google地图添加地点

[英]How to add places to google map using google API in c#

I have multiple places store in my db . 我的数据库中存储了多个位置。 places contain (Longitude,latitude,Name,Website,phone,...) . 地点包含(经度,纬度,名称,网站,电话等)。 I want to add these place to google maps using c# method. 我想使用C#方法将这些地方添加到Google地图。 How can I Send place to google maps ? 如何将地点发送到Google地图?

You might want to have a look at this one: 您可能想看一看:

Calling JavaScript Function From CodeBehind 从CodeBehind调用JavaScript函数

There are two solutions: 有两种解决方案:

Use the JS 使用JS

In short terms: 简而言之:

  1. You do the Google API requests still via JS 您仍然通过JS执行Google API请求
  2. Your C# Backend is doing the Database calls and 您的C#后端正在执行数据库调用,并且
  3. Routes the parameters to the JS via the above 通过上述将参数路由到JS

I think that should work without a problem. 我认为这应该没有问题。

Send API Requests purely by C# 仅通过C#发送API请求

The Google Maps API can, of course be requested by you by sending out the JSON calls. 当然,您可以通过发送JSON调用来请求Google Maps API。

This post gives guidance in that: google maps API for C# 这篇文章在以下方面提供了指导: Google Maps API for C#

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

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