我是C#的菜鸟,这是我的第一种编程语言,目前我正在通过简而言之的书C#进行努力。我已经启动了一个项目来自动化我整天工作的许多工作。
如果有可能,任何人都可以推荐一个好地方,开始研究如何做到这一点?我唯一能找到的资源是:
Google地图在C#
中自动完成文本框,但他说最后他永远无法正常工作。它使我有一个想法,但我不知道他在做什么错。
我想实现订单放置系统,用户需要做的第一件事就是输入客户名称和地址。
最终游戏正在获取地址并将其与存储地址的数据库进行比较,如果邮政/邮政编码匹配,则加载帐户,如果未使用地址详细信息创建新帐户。p>能够使用Microsoft或Google API会阻止我不得不托管一个具有英国每个地址的数据库。
编辑:https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform
根据Google,以下是此功能但在网页中的JavaScript代码。如您所见,注释指出,js库 place 是必需的。这是否意味着我不能仅仅在转换上工作,并且会丢失一些功能。这全都嵌入了我尚未包括的HTML中:
// This example displays an address form, using the autocomplete feature
// of the Google Places API to help users fill in the information.
// This example requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js? key=YOUR_API_KEY&libraries=places">
var placeSearch, autocomplete;
var componentForm = {
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'short_name',
country: 'long_name',
postal_code: 'short_name'
};
function initAutocomplete() {
// Create the autocomplete object, restricting the search to geographical
// location types.
autocomplete = new google.maps.places.Autocomplete(
/** @type {!HTMLInputElement} */(document.getElementById('autocomplete')),
{types: ['geocode']});
// When the user selects an address from the dropdown, populate the address
// fields in the form.
autocomplete.addListener('place_changed', fillInAddress);
}
function fillInAddress() {
// Get the place details from the autocomplete object.
var place = autocomplete.getPlace();
for (var component in componentForm) {
document.getElementById(component).value = '';
document.getElementById(component).disabled = false;
}
// Get each component of the address from the place details
// and fill the corresponding field on the form.
for (var i = 0; i < place.address_components.length; i++) {
var addressType = place.address_components[i].types[0];
if (componentForm[addressType]) {
var val = place.address_components[i][componentForm[addressType]];
document.getElementById(addressType).value = val;
}
}
}
// Bias the autocomplete object to the user's geographical location,
// as supplied by the browser's 'navigator.geolocation' object.
function geolocate() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var geolocation = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
var circle = new google.maps.Circle({
center: geolocation,
radius: position.coords.accuracy
});
autocomplete.setBounds(circle.getBounds());
});
}
}
bing地图仅通过其Web控件提供自动建议/完成。您可以在应用程序中的Web浏览器控件内部托管此内部,但这会很混乱,并且可能无法与布局合作。
看基于Azure位置的服务。他们有几种休息服务,可用于自动建议/完成地址/地点,兴趣点等。只需将typeahead
URL参数设置为true即可将服务纳入预测模式。这是一些有用的资源:
- https://learn.microsoft.com/en-us/azure/location sup-services/tutorial-search-location
- https://learn.microsoft.com/en-us/rest/api/location-suet-services/search/getsearchaddress
- https://learn.microsoft.com/en-us/rest/api/location-suet-services/search/getsearchfuzzy
- https://learn.microsoft.com/en-us/rest/api/location-suet-services/search/getsearchpoi
- https://learn.microsoft.com/en-us/rest/api/location-suet-services/search/getsearchpoicategory