maps

How can I change the default loading tile color in LeafletJS?

雨燕双飞 提交于 2019-12-01 02:14:40
By default, when leafletJS is loading a map, the background tiles are all grey. I'd like to change that color to be black (or any other arbitrary color). How can I go about doing this? It's controlled by the below css rule in the file 'leaflet.css': .leaflet-container { background: #ddd; } so you just need to change this rule. 来源: https://stackoverflow.com/questions/13851888/how-can-i-change-the-default-loading-tile-color-in-leafletjs

Select points from map database according to radius

若如初见. 提交于 2019-12-01 02:00:44
I have a database which has latitude/longitude of points. If I want to select all points within a specific range centered in a specific point it works fine BUT if there is any point located at this center, it will not get selected! I use this query: SELECT *, ( 6371 * acos( cos( radians(-27.5796498) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(-48.543221) ) + sin( radians(-27.5796498) ) * sin( radians( latitude ) ) ) ) AS distance FROM map HAVING distancia <= 2 In the case above the radius is "2" and the center of the map is at [-27.5796498,-27.5796498]. This query

Google Maps API: Bézier curve polyline wrap

偶尔善良 提交于 2019-12-01 01:43:18
By using the Bezier curve polyline draw function provided by nicoabie I was able to draw a curved line from one point on the map to another. The problem is that this function does not take in to account the fact that when a point is past the maximum coordinate mark it is not necessarily on the other side of the map, since it wraps around. For example, drawing a curved line from Seattle to Tokyo. A regular polyline would go across the Pacific ocean, but the the curved line draws east across the whole globe. geodesic: true does not work in this case since the line must have a consistent

D3js cartography: auto-focus on geographic area ? (svg canvas, zoom scale, coordinate translation)

北城余情 提交于 2019-12-01 01:12:34
I processed SRTM raster data to generate shapefiles -> geojson -> topojson so I may feed D3js with a suitable format. The result look like this (the blue area is my oversized svg canvas): Given geographic area of interest geo-borders (west border, North, East, South) and center : // India geo-frame borders in decimal ⁰ var WNES = { "W": 67.0, "N":37.5, "E": 99.0, "S": 5.0 }; // India geo-center : var latCenter = (WNES.S + WNES.N)/2, lonCenter = (WNES.W + WNES.E)/2; // HTML expected frame dimensions var width = 713, height = 724; // Projection: projection, center coord, scale(?), translate: var

Merge multiple Sass maps

牧云@^-^@ 提交于 2019-12-01 01:10:55
I have three Sass maps that I want to merge into one map. With the map-merge function I can only merge two maps together. How can I merge more than two maps? A shortened example of my situation: $color-name: ( blue: ( default: blue, dark: navy, light: sky ) ); $color-event: ( danger: ( default: set($color-name, red), dark: set($color-name, red, dark), light: set($color-name, red, light), ) ); $color-category: ( heading: ( default: set($color-name, grey), dark: set($color-name, grey, dark), light: set($color-name, grey, light) ) ); $color: map-merge($color-name, $color-event, $color-category);

Leaflet: Add a link to the markers

你。 提交于 2019-12-01 00:51:56
问题 Pretty simple question: How can I make the map markers in Leaflet clickable and route the user to an other page? Every marker has its own page. I've tried the following without success; somehow all the markers point to the same page, which is the last assigned URI. var markers = [ { coords: [51.505, -0.09], uri: '/some-page' }, ... ]; for(x in markers) { L.marker(markers[x].coords).on('click', function() { window.location = markers[x].uri; }).addTo(map); } This issue is really driving me nuts

How to use the QML/QtLocation module for displaying a large amount of offline data on a map?

一笑奈何 提交于 2019-12-01 00:38:48
I'm in the process of creating an offline Slippy Map using QML and their new QtLocation module (>=Qt5.4). I managed quite easily to display the tiles with an offline cache. Now I would like to add custom data to this map (a list of ~7000 airports). This huge list would have to be clustered depending on the zoom level (for performance and readability reasons, unless the QtLocation has built-in "optimizations"..?. What would be to most elegant/best way to achieve this, staying as close as possible to the Qt/QML APIs? I saw some interesting stuff about a similar approach here: How to handle large

MapOverlay binding not working

两盒软妹~` 提交于 2019-11-30 23:49:55
I'm trying to get a map overlay working on Windows Phone 8 using an MVVM code structure. I can't seem to get the GeoCoordinate property of the MapOverlay to bind to my ViewModel properly and I can't work out why. The XAML as stands is: Header: xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps" Code: <maps:Map x:Name="Map" ZoomLevel="6" Height="500" Width="500" CartographicMode="Terrain" Center="{Binding MapCenter, Converter={StaticResource GpsCoordinateConverter}, Mode=TwoWay}"> <maps:Map.Layers> <maps:MapLayer> <maps:MapOverlay PositionOrigin="1,1"

[leetcode 周赛 157] 1217 玩筹码

大兔子大兔子 提交于 2019-11-30 22:47:11
1217 Play With Chips 玩筹码 题目描述 数轴上放置了一些筹码,每个筹码的位置存在数组 chips 当中。 你可以对 任何筹码 执行下面两种操作之一(不限操作次数, 0 次也可以): 将第 i 个筹码向左或者右移动 2 个单位,代价为 0 。 将第 i 个筹码向左或者右移动 1 个单位,代价为 1 。 最开始的时候,同一位置上也可能放着两个或者更多的筹码。 返回将所有筹码移动到同一位置(任意位置)上所需要的最小代价。 示例 1: 输入 :chips = [1,2,3] 输出 :1 解释 :第二个筹码移动到位置三的代价是 1,第一个筹码移动到位置三的代价是 0,总代价为 1。 示例 2: 输入 :chips = [2,2,2,3,3] 输出 :2 解释 :第四和第五个筹码移动到位置二的代价都是 1,所以最小总代价为 2。 提示: 1 <= chips.length <= 100 1 <= chips[i] <= 10^9 思路 读题 移动奇数次位置代价为1, 移动偶数次位置代价为0, 寻找一个位置, 距离其他位置的距离尽量都是偶数 思路一 遍历所有位置, 选取最小代价 使用HashMap<Integer, Integer>存储 位置 和 该位置上的元素个数 循环变量, 每个位置与其他位置的距离, 加上其他位置的元素个数, 从而计算出代价 选出最小代价输出

google maps height 100% of div parent

本小妞迷上赌 提交于 2019-11-30 22:33:16
Is it possible make a google map height 100% of the parent div? I noticed that with the height 100%, the map is not visible, but if I add the height of the div with the map in pixel the map is correctly visualize. is there some tricks to achieve the map 100% of the parent div? this doesn't works <div class="block halfrect"> <div id="map" style="height:100%;"></div> </div> this works <div class="block halfrect"> <div id="map" style="height:590px;"></div> </div> any idea? reference: Mike Williams' Google Maps Javascript API v2 tutorial page: Using a percentage height for the map div If you try