maps

How to get onTap in Polygon in osmdroid?

久未见 提交于 2019-12-24 05:17:33
问题 I have lot's of polygon drawn. Some of which overlaps. I want to be able to detect a tap inside the polygon and display a dialog saying it was clicked inside the polygon (this polygon should be detected on tap). This kind of property can be seen with ItemizedIconOverlay where we can detect all of the OverlayItem with the tap on the OverlayItem. How to implement this on polygon? The way I draw and add Polygon is: MyPolygon myNewPolygon = new MyPolygon(this); myPolygon.setPoints(Polygon

Find in which country each point-coordinate belongs to [duplicate]

狂风中的少年 提交于 2019-12-24 04:34:32
问题 This question already has answers here : Convert latitude and longitude coordinates to country name in R (2 answers) Closed 6 years ago . I have a data frame with lat/lon coordinates: head(COORD) LAT LON 1 69.34 16.17 2 69.20 17.92 3 69.59 17.87 4 69.17 18.52 5 69.42 18.95 6 69.22 18.91 I would like to to retrieve the country name of each point and add it as a third column. Maybe using which in combination with map to retrieve in which polygon the points are but I was not able to figure out

Now that Android 4.0 is out, is Multi Touch possible in android emulator?

孤街浪徒 提交于 2019-12-24 02:52:22
问题 There are similar questions like this uptill Android 2.3 sdk on Stackoverflow. But as per the answers it was not supported back then. I have even seen a feature request ticket for it with Google but it is still pending! With the recent release of 4.0 sdk, does any one know if it is now possible to simulate the multi-touch feature in the emulator? If yes, please do information on how to do it. Thanks in advance! 回答1: Multitouch in the emulator is still unsupported and has not been announced as

Google Map API v3 - Centre Map on Markers

北城以北 提交于 2019-12-24 00:59:17
问题 I've recently started using Google Maps API v3. I need to plot some locations (maybe 3 or 4) and at the same time, centre the map on these points - as opposed to manually having to set the long and lat for the map to centre on... Can someone share some tips, or point me in the right direction? Thanks in advance! Dan function initialize() { var latlng = new google.maps.LatLng(51.50816, 0.02712); var myOptions = { zoom: 12, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var

ggplot - Create a border overlay on top of map

谁说胖子不能爱 提交于 2019-12-24 00:45:56
问题 So I am trying to create a Florida county-level map with borders based on a custom variable. I included an older version of the map that I am trying to create here Essentially, the map shows a region breakdown of Florida counties, with media markets outlined with a bolded-black line border. I am able to plot the regions easily enough. What I am hoping to add is a bolder, black line border around outside of the regions defined by the media market variable "MMarket", similar to that of the map

Using C++ STL maps in Cython

北城以北 提交于 2019-12-24 00:45:49
问题 I'm trying to use a map in a Cython class but the Cython compiler raises an error. Here is an example demonstrating my problem and the error reported by Cython. Cython file pyx from libcpp.map cimport map from libcpp.utility cimport pair from libcpp.string cimport string cdef class MyDict: cdef: map[string, int] components def __setitem__(self, key, value): self.components[key] = value def __getitem__(self, key): return self.components[key] Python file from pyximport import install install()

JavaScript写一个拼图游戏

走远了吗. 提交于 2019-12-23 20:39:55
  拼图游戏的代码400行, 有点多了, 在线DEMO的地址是: 打开 ;   因为使用canvas,所以某些浏览器是不支持的: you know;    为什么要用canvas(⊙o⊙) ? 因为图片是一整张jpg或者png, 我们要用把图片导入到canvas画布, 然后再调用 上下文context 的 getImageData 方法, 把图片处理成小图, 这些小图就作为拼图的基本单位;    如何判断游戏是否结束 , 或者说如何判断用户拼成的大图是正确的? 我们就要在刚刚生成的小图上面 添加自定义属性 , 后期在小图被移动后再一个个判断,如果 顺序是对 的, 那么这张大图就拼接成功, 允许进入下一关;      游戏一共有四个关卡, 不会有人通关的,真的....因为第四关把图片的宽高分别切成了6份, 看着都晕好吧(∩_∩);           因为要考虑到 移动端 的效果, 所以主界面图片是 根据屏幕适配 , 拼图大图的大小是屏幕宽度和屏幕高度之间最小值的一半, 都是为了不出现滚动条。 比如:用户的手机是横屏模式, 这个横屏的宽度是1000px,高度是300px, 如果我们把主图片的宽设置为屏幕1000px的一半500, 那么垂直方向就出滚动条了;   用户的事件只要考虑 上下左右四个方向键 即可, 要判断图片是否可以移动, 也要考虑到当图片移动的时候的 动画效果

Free Silverlight mapping with Bing maps and OpenStreetMap?

余生颓废 提交于 2019-12-23 20:12:55
问题 I recently read this article. Which uses the Silverlight Bing maps control to display map data from OpenStreetMap. In this article he extends MapCore and develops a true OpenStreetMap control which no longer requires you to use the Bing API key. My question is simple. Does this solution constitute free Silverlight mapping for commercial projects or does the use of the Bing map control itself require licensing? Thanks in advance. 回答1: Following excerpted from the Microsoft Bing Maps Terms of

How to convert a set of point coordinates from a concave hull into a polygon in R?

情到浓时终转凉″ 提交于 2019-12-23 19:14:53
问题 I have an alphahull::ashape() result that I need to convert with spatstat::owin() for subsequent spatial analyses. Is there an elegant solution how to order the points from the concave hull and convert the shape to an owin object or any Spatial* object? With ordered points in a hypothetical matrix coords the polygon is defined as: geo.owin=try(owin(poly=list(x=coords[,1],y=coords[,2])),silent=T) if(class(geo.owin)=="try-error") geo.owin=owin(poly=list(x=rev(coords[,1]),y=rev(coords[,2])))

Clipping rasters in R

て烟熏妆下的殇ゞ 提交于 2019-12-23 18:41:23
问题 I am building a map for the northeastern U.S.A. The map background needs to be either an altitude map or a mean annual temperature map. I have two rasters from Worldclim.org which give me these variables but I need to clip them to the extent of the states I am interested in. Any suggestions on how to do this. This is what I have so far: #load libraries library (sp) library (rgdal) library (raster) library (maps) library (mapproj) #load data state<- data (stateMapEnv) elevation<-raster("alt