久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='5kCm5'></bdo><ul id='5kCm5'></ul>
    <legend id='5kCm5'><style id='5kCm5'><dir id='5kCm5'><q id='5kCm5'></q></dir></style></legend>
    <tfoot id='5kCm5'></tfoot>
    <i id='5kCm5'><tr id='5kCm5'><dt id='5kCm5'><q id='5kCm5'><span id='5kCm5'><b id='5kCm5'><form id='5kCm5'><ins id='5kCm5'></ins><ul id='5kCm5'></ul><sub id='5kCm5'></sub></form><legend id='5kCm5'></legend><bdo id='5kCm5'><pre id='5kCm5'><center id='5kCm5'></center></pre></bdo></b><th id='5kCm5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5kCm5'><tfoot id='5kCm5'></tfoot><dl id='5kCm5'><fieldset id='5kCm5'></fieldset></dl></div>

    <small id='5kCm5'></small><noframes id='5kCm5'>

    1. 舍入經(jīng)緯度以在 Google 地圖中顯示大致位置

      Rounding Lat and Long to Show Approximate Location in Google Maps(舍入經(jīng)緯度以在 Google 地圖中顯示大致位置)
        <tfoot id='KuiO4'></tfoot>
          <tbody id='KuiO4'></tbody>
        <i id='KuiO4'><tr id='KuiO4'><dt id='KuiO4'><q id='KuiO4'><span id='KuiO4'><b id='KuiO4'><form id='KuiO4'><ins id='KuiO4'></ins><ul id='KuiO4'></ul><sub id='KuiO4'></sub></form><legend id='KuiO4'></legend><bdo id='KuiO4'><pre id='KuiO4'><center id='KuiO4'></center></pre></bdo></b><th id='KuiO4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='KuiO4'><tfoot id='KuiO4'></tfoot><dl id='KuiO4'><fieldset id='KuiO4'></fieldset></dl></div>

          <legend id='KuiO4'><style id='KuiO4'><dir id='KuiO4'><q id='KuiO4'></q></dir></style></legend>
            <bdo id='KuiO4'></bdo><ul id='KuiO4'></ul>

              • <small id='KuiO4'></small><noframes id='KuiO4'>

                本文介紹了舍入經(jīng)緯度以在 Google 地圖中顯示大致位置的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我正在我的 Rails 應(yīng)用程序視圖中顯示 Google 地圖,并將使用標(biāo)記/覆蓋.

                I'm displaying a Google map in my Rails app's view and will be using a marker/overlay.

                坐標(biāo)數(shù)據(jù)將來自手機(jī) (GPS) 并存儲(chǔ)在我的 Rails 應(yīng)用程序的數(shù)據(jù)庫中.

                The coordinate data will be coming from a phone (GPS) and stored in my Rails app's db.

                問題是,我不希望在我的網(wǎng)頁源中顯示精確的緯度/經(jīng)度……也就是說,我想標(biāo)記一個(gè)大概的位置,而不泄露真正的緯度/經(jīng)度.

                The problem is, I don't want the precise lat/long visible in the source of my web page ... i.e. I want to mark an approximate location without giving away the true lat/long.

                如何舍入/截?cái)嗑暥?經(jīng)度值,使它們?nèi)匀粶?zhǔn)確(例如,在一英里內(nèi)),但又不太準(zhǔn)確?

                How can I round/truncate the lat/long values so they are still accurate (say, within a mile)–but not too accurate?

                (例如:你將如何舍入 35.2827524, -120.6596156 ?)

                (Example: how would you round 35.2827524, -120.6596156 ?)

                推薦答案

                最簡單的做法是將兩個(gè)坐標(biāo)四舍五入到一定的小數(shù)位,或者在坐標(biāo)上添加隨機(jī)抖動(dòng):

                The easiest thing to do would be either to round both coordinates to a certain number of decimal places, or add a random dither to the coordinates:

                lat = Math.floor(lat*1000+0.5)/1000; (round within 0.001)
                

                dither=0.001;
                lat = lat + (Math.random()-0.5)*dither;
                

                如果你真的想在一定的英里數(shù)內(nèi),你需要做更復(fù)雜的數(shù)學(xué),可能使用極坐標(biāo).

                If you really want to be within a certain number of miles, you'd need to do more-complex math, probably using polar coordinates.

                這篇關(guān)于舍入經(jīng)緯度以在 Google 地圖中顯示大致位置的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項(xiàng)目中不起作用)
                Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數(shù)據(jù)更新 Observable)
                Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創(chuàng)建使用 Ionic 組件的自定義指令?)
                Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動(dòng)態(tài)元素 - Angular 2 amp;離子2)

                <legend id='WmuSI'><style id='WmuSI'><dir id='WmuSI'><q id='WmuSI'></q></dir></style></legend>
                    <tbody id='WmuSI'></tbody>
                      • <i id='WmuSI'><tr id='WmuSI'><dt id='WmuSI'><q id='WmuSI'><span id='WmuSI'><b id='WmuSI'><form id='WmuSI'><ins id='WmuSI'></ins><ul id='WmuSI'></ul><sub id='WmuSI'></sub></form><legend id='WmuSI'></legend><bdo id='WmuSI'><pre id='WmuSI'><center id='WmuSI'></center></pre></bdo></b><th id='WmuSI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='WmuSI'><tfoot id='WmuSI'></tfoot><dl id='WmuSI'><fieldset id='WmuSI'></fieldset></dl></div>
                        • <bdo id='WmuSI'></bdo><ul id='WmuSI'></ul>
                          <tfoot id='WmuSI'></tfoot>
                        • <small id='WmuSI'></small><noframes id='WmuSI'>

                        • 主站蜘蛛池模板: 狠狠综合久久av一区二区小说 | 欧美一级特黄aaa大片在线观看 | 日韩精品在线观看网站 | 国产高清在线视频 | 综合一区二区三区 | 精品日韩一区 | 一区二区三区四区在线视频 | 99re热精品视频国产免费 | 国产伦精品一区二区三区照片91 | 操久久| 亚洲a级| 日韩在线欧美 | 精品久久久久久久久久久 | 久久成人18免费网站 | 天堂一区在线 | 日韩中文久久 | 欧美日韩在线一区 | 看片91| 中文字幕一级 | 国产精品一区一区 | 成人毛片网站 | 亚州av | 日韩在线中文 | 6996成人影院网在线播放 | 久久这里只有精品首页 | 日本在线免费看最新的电影 | 欧美老妇交乱视频 | 中文字幕一二三区 | 黄视频国产 | 精品成人 | 精品中文字幕一区 | 亚洲一区二区三区免费在线观看 | 亚洲欧美中文字幕在线观看 | 北条麻妃国产九九九精品小说 | 日韩一级精品视频在线观看 | 久久香焦 | 国产高清一区二区三区 | 中文字幕在线不卡播放 | 欧美日韩国产在线观看 | 久久久久国产 | 国产午夜精品一区二区三区在线观看 |