【发布时间】:2014-07-11 15:30:24
【问题描述】:
我正在尝试制作一个应用程序,以便用户能够单击链接(链接是位置),它将打开谷歌地图并将它们定向到该位置。我有以下代码:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>ECC</title>
</head>
<body ng-app="app">
<div ng-controller="firstCtrl">
<input type="text" ng-model="search"/>
<ul>
<li ng-repeat="site in SiteLocs |filter : search ">{{site.name}}</li>
</ul>
</div>
</body>
</html>
JS
var app = angular.module('app', []);
app.controller('firstCtrl', function($scope){
$scope.SiteLocs = [
{
"name": "502 Nelson St, Greenville, MS 38701",
"visibility": "0",
"description": "502 Nelson St, Greenville, MS 38701",
"styleUrl": "#waypoint",
"Point": {
"coordinates": "-91.05636,33.415485,0"
}
}
,
{
"name": "242 Blackhawk Trace, Galena, IL 61036",
"visibility": "0",
"description": "242 Blackhawk Trace, Galena, IL 61036",
"styleUrl": "#waypoint",
"Point": {
"coordinates": "-90.319778,42.390862,0"
}
}, (ect... there are a couple thousand of these so I wont add them all..)
];
});
我需要帮助的是链接它的自我。我不知道如何将列表链接到使用 href。有人有什么想法吗?
【问题讨论】:
-
好的,那你有什么问题?你真的没有问问题。你的代码不工作吗?或者你不知道如何实现你想要的?没有人会给你完整的代码来做你所要求的,但他们会很乐意帮助你解决你遇到的问题,
-
然后将其编辑到您的问题中。
标签: javascript html arrays angularjs google-maps