maps

Do embedded GeoJSON styles work with Mapbox GL?

旧城冷巷雨未停 提交于 2019-12-08 02:35:59
问题 Is it possible to utilize the built-in properties attribute of a GeoJSON data source to automatically style a Mapbox GL map without having to pre-specify a style? I have a use case where I dynamically load in GeoJSON LineString data that needs to be a particular color and it already has style data built in: {"properties": {"color": "#ffff33"... Right now, I have a rather inelegant setup where the relevant color is parsed out, translated into a style, and added to the map upon every load:

Calculate X and Y position on a PNG Map from GPS Coordinate

喜你入骨 提交于 2019-12-08 02:02:30
问题 I'm implementing a custom maps (image with size map_width and map_height) on an iPhone app and i try to show the current user position on this map (current_long and current_lat) I have 2 references points with a known GPS coordinates (ref1_long, ref1_lat, ref2_long and ref2_lat) and known X, Y positions in pixels (ref1_x, ref1_y, ref2_x and ref2_y) My question is: how to calculate the current_x and current_y according to these informations ? 回答1: You need to know the projection of the map.

How to add color to map by region?

杀马特。学长 韩版系。学妹 提交于 2019-12-08 01:56:39
问题 The Data The code # # This is code for mapping of CGE_Morocco results # # rm(list = ls(all = TRUE)) # don't use this in code that others will copy/paste ## Loading packages library(rgdal) library(plyr) library(maps) library(maptools) library(mapdata) library(ggplot2) library(RColorBrewer) ## Loading shape files administrative coordinates for Morocco maps #Morocco <- readOGR(dsn=".", layer="Morocco_adm0") MoroccoReg <- readOGR(dsn=".", layer="Morocco_adm1") ## Reorder the data in the shapefile

Creating map of Africa using d3.js and topoJSON

醉酒当歌 提交于 2019-12-08 01:04:03
问题 i want to create map of Africa using d3.js and topoJSON. I have that datasource https://gist.githubusercontent.com/bricedev/3905007f1794b0cb0bcd/raw/ad5c995f6990f7c3c7fad5c6206bc6fd5462f1fb/africa.json That is my code. How i can get properties and create correct map? Please help me where is the error? <!DOCTYPE html> <html> <head> <meta name="description" content="D3byEX 12.15" /> <meta charset="utf-8"> </head> <body> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http:/

Show Popup when Location access is disable by user (Andorid Google Maps)

亡梦爱人 提交于 2019-12-08 00:57:09
问题 how can i show popup which as enable your location access and open Location access intent. right now i am creating app that contain map. i have enabled (map.setMyLocationEnabled(true)). and the app show the current location button but when location access is disable it doesnt show any response. I want if the location access is disable a popup show which says user to enable the location access thanks in advance 回答1: this code while give you all you want, is any kind of location service

Changing the text in legend in ggplot map R Studio

穿精又带淫゛_ 提交于 2019-12-08 00:32:35
问题 I am trying to create a US map filled with heat level of flu diseases. I am having 2 issues: I couldn't change the variable text in the legend. The order of the legend is wrong. 1->10->2->... Here is the code. library(maps) library(ggplot2) # Get all states data all_states <- map_data("state") # Clean the data subHeat <- subset(q4_heatMap, WEEK=="4") region <- tolower(subHeat$STATENAME) stateHeat <- subHeat$ACTIVITY.LEVEL stateHeat <- gsub('Level ', '', stateHeat) usHeat <- data.frame(region

Crispy edges with topojson?

房东的猫 提交于 2019-12-07 23:41:58
问题 Mike Bostock shared a range of world wide topojson files. As I wanted more data and higher quality, I now generate my own high quality topojson files from Natural Earth. To make it simple, my makefile / command is such: admin_0: crop ../node_modules/topojson/bin/topojson \ --id-property name \ -p name=name \ -q 1e4 \ --filter=small \ -o admin_0.topo.json \ -- admin_0=./natural_earth_vector/10m_cultural/ne_10m_admin_0_countries.shp But my 3MB .topojson is crispy, nasty, graphically messy. Take

how to display a projected map on an R::lattice::layerplot?

半城伤御伤魂 提交于 2019-12-07 23:40:31
summary: I can display a lon-lat map on a lattice::layerplot , and I can display a Lambert conformal conic (LCC) map on a spam::image . How to display an LCC map on a lattice::layerplot ? Examples of how not to do it follow--assistance in fixing is appreciated (or even just debugging). details: I've been using trellis graphics (via latticeExtra and rasterVis ) successfully to display unprojected lon-lat global atmospheric data, which works well enough (though I am definitely intrigued by ggplot / ggmap ). Particularly, I am able to overlay those plots with maps, which is essential for the sort

Region polygons not displaying in ggplot2 Choropleth map

只谈情不闲聊 提交于 2019-12-07 21:37:40
问题 I'm trying to do a very basic map plot with ggplot2. I can't find why the colored polygons would not display. It seems that my code is no different from what I can find on the many tutorials and the questions already answered on this website. I think it could come from the way I prepare the data (see 100% reproducible example below). library(maptools) library(sp) library(ggplot2) library(rgeos) con <- url("http://biogeo.ucdavis.edu/data/gadm2/R/GHA_adm1.RData") print(load(con)) close(con)

Android location fix inaccurate/old but Google Maps works

别等时光非礼了梦想. 提交于 2019-12-07 20:48:32
问题 This is a strange issue which mostly appears on Samsung devices but I cannot confirm its only on Samsung. My app won't get or update to the correct location fix. It listens to GPS, network and cell providers but the location fix I get is still outdated and inaccurate sometimes the fix is like a day earlier. I thought it might be a bug in my code but then I opened other apps (Yelp, etc...) and they also have the same problem. I then open Google Maps and the location is perfectly accurate and