Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 获取基于当前纬度和经度的本地地图_Asp.net_Google Maps Api 3 - Fatal编程技术网

Asp.net 获取基于当前纬度和经度的本地地图

Asp.net 获取基于当前纬度和经度的本地地图,asp.net,google-maps-api-3,Asp.net,Google Maps Api 3,如何找到社区,看看他们是否靠近市中心、公园或其他感兴趣的地方。在给定的纬度和经度范围内,我们如何到达附近的超市、五金店、餐馆和其他地方 <!DOCTYPE html> <html> <head> <title>Place searches</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset=

如何找到社区,看看他们是否靠近市中心、公园或其他感兴趣的地方。在给定的纬度和经度范围内,我们如何到达附近的超市、五金店、餐馆和其他地方

<!DOCTYPE html>
<html>
<head>
<title>Place searches</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<link href="/maps/documentation/javascript/examples/default.css" rel="stylesheet">

    <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true&libraries=places"></script>


<script type="text/javascript">
var map;
var service;
var infowindow;

function initialize() {
var pyrmont = new google.maps.LatLng(-33.8665433,151.1956316);

map = new google.maps.Map(document.getElementById('map'), {
  mapTypeId: google.maps.MapTypeId.ROADMAP,
  center: pyrmont,
  zoom: 15
});

地点搜索
var映射;
var服务;
var信息窗口;
函数初始化(){
var pyrmont=new google.maps.LatLng(-33.8665433151.1956316);
map=new google.maps.map(document.getElementById('map'){
mapTypeId:google.maps.mapTypeId.ROADMAP,
中心:皮尔蒙特,
缩放:15
});
var请求={ 地点:皮尔蒙特, 半径:'500', 询问:“餐厅” })

service=newgoogle.maps.places.PlacesService(地图);
文本搜索(请求、回调);
}
函数回调(结果、状态){
if(status==google.maps.places.PlacesServiceStatus.OK){
对于(var i=0;i
请查看该方法。它允许你搜索像“悉尼附近的餐馆”之类的东西。但是没有地图显示给我。请告诉我需要添加哪些额外代码。我已经发布了我的代码。请验证我的代码。提前感谢给地图画布一个高度。
service = new google.maps.places.PlacesService(map);
service.textSearch(request, callback);
}

function callback(results, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
  var place = results[i];
  createMarker(results[i]);
  }
}
}

</script>

</head>
<body onload="initialize()">
<div id="map-canvas" style="width: 50%; float: left">
</div>
</body>
</html>