所以我试图显示给定lat/lng范围内的位置列表.我对此没有任何问题:
一英里内的地方(地点列表......)
使用类似的东西
SELECT * FROM places WHERE lat < $latmax AND lat > $latmin AND lng < $lngmax AND lng > $lngmin
Run Code Online (Sandbox Code Playgroud)
但后来我想列出两英里内的地方,但不在一英里内 - 也就是说,我不想重复第一次查询的结果.
这是我尝试过的一个版本:
$milesperdegree = 0.868976242 / 60.0 * 1.2;
// 1 mile -- this works
$degrees = $milesperdegree * 1;
$latmin = $lat - $degrees;
$latmax = $lat + $degrees;
$lngmin = $lng - $degrees;
$lngmax = $lng + $degrees;
$query = "SELECT * FROM places WHERE lat < $latmax AND lat > $latmin AND …Run Code Online (Sandbox Code Playgroud) 无法点击填充(绿色)后面的“完成我们的提交表单”链接。
所有填充(以及相等的负边距)的原因是为了在跳转到长列表中的锚点时补偿固定的顶部导航栏。
我尝试过乱搞,z-index但这似乎没有任何作用。有什么想法吗?
h3.place-category {
margin-top: calc(-93px + -1rem);
padding-top: calc(93px + 1rem);
}
.places-complete-list {
position: relative;
width: 100%;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
flex: 0 0 66.66667%;
max-width: 66.66667%;
}Run Code Online (Sandbox Code Playgroud)
<div class="container">
<section class="places-content">
<p>...</p>
<p>... To add a place please <a href="/places/submit/">complete our submission form</a>.</p>
</section>
<section class="places-complete-list">
<h3 class="place-category" id="antique-shops"><a href="/places/category/antique-shops/">Antique Shops</a></h3>
<ul>
<li>...</li>
</ul>
</section>
</div>Run Code Online (Sandbox Code Playgroud)