maps

A MapKit for Mac OS X?

落花浮王杯 提交于 2019-11-30 05:04:17
on the iPhone we have the Apple's amazing MapKit. There is something similar for Mac OS X? If possible something more advanced than a simple WebView, because I need that it manage automatically at least: annotations the user interaction the zoom in/out an overlay view (Even if the maps are not from Google is ok.) Thank you very much! Jason Medeiros Update 2 MapKit is available in OS X 10.9 Mavericks : Map Kit Framework Reference . Update - pulled from my comment below The situation has changed and there now exists a third party MapKit for Mac OS X. Find it at http://github.com/Oomph/MacMapKit

Plotting a raster with the color ramp diverging around zero

一笑奈何 提交于 2019-11-30 04:17:40
I am trying to plot a map with positive and negative values. All positive values should have red color while negative should have blue color and zero should have white just like in this sample plot with discrete colors Below is the code I'm using: library (rasterVis) ras1 <- raster(nrow=10,ncol=10) set.seed(1) ras1[] <- rchisq(df=10,n=10*10) ras2=ras1*(-1)/2 s <- stack(ras1,ras2) levelplot(s,par.settings=RdBuTheme()) Thanks very much for providing a general solution which can be applied in other mapping exercises as well. jbaums I wrote a gist to do this. It takes a trellis object generated by

Conversion of lat/lng coordinates to pixels on a given map (with JavaScript)

拥有回忆 提交于 2019-11-30 02:31:58
I have put together a cities database from MaxMind and it includes the lat/lng values for each city in the database. I have also put together a map of North/America and I would like to have a icon appear on the x/y coordinates of the map which are derived from the lat/lng coordinates of the city database record. From my understanding I need to find the left/top bounds of the map first (lat/lng -> x/y) and then use that as a difference for the linear relationship between any of the north american city x/y coords. Finally, depending on the size of the map, its just a few simple division and

Finding City and Zip Code for a Location

强颜欢笑 提交于 2019-11-30 02:31:21
Given a latitude and longitude, what is the easiest way to find the name of the city and the US zip code of that location. (This is similar to https://stackoverflow.com/questions/23572/latitude-longitude-database , except I want to convert in the opposite direction.) Related question: Get street address at lat/long pair This is the web service to call. http://developer.yahoo.com/search/local/V2/localSearch.html This site has ok web services, but not exactly what you're asking for here. http://www.usps.com/webtools/ Any of the online services mentioned and their competitors offer "reverse

How can I detect the last iteration in a loop over std::map?

こ雲淡風輕ζ 提交于 2019-11-30 00:57:37
问题 I'm trying to figure out the best way to determine whether I'm in the last iteration of a loop over a map in order to do something like the following: for (iter = someMap.begin(); iter != someMap.end(); ++iter) { bool last_iteration; // do something for all iterations if (!last_iteration) { // do something for all but the last iteration } } There seem to be several ways of doing this: random access iterators, the distance function, etc. What's the canonical method? Edit: no random access

How can I use SVG translate to center a d3.js projection to given latitude and longitude values?

六月ゝ 毕业季﹏ 提交于 2019-11-29 23:56:02
问题 I am using d3 to render a Mercator projection of a GeoJSON world map. I would like to be able to use d3 to scale, and translate the map to known latitude and longitude values as the user steps through my application. projection.center (https://github.com/mbostock/d3/wiki/Geo-Projections#wiki-center) does what I'd like, combined with transition().duration() , but this requires redrawing the map and therefore seems expensive to keep repeating. I would like to use the native translate() and

Dynamically add data to a javascript map

别来无恙 提交于 2019-11-29 23:31:35
Is there a way I can dynamically add data to a map in javascript. A map.put(key,value) ? I am using the yui libraries for javascript, but didn't see anything there to support this. Well any Javascript object functions sort-of like a "map" randomObject['hello'] = 'world'; Typically people build simple objects for the purpose: var myMap = {}; // ... myMap[newKey] = newValue; edit — well the problem with having an explicit "put" function is that you'd then have to go to pains to avoid having the function itself look like part of the map. It's not really a Javascripty thing to do. 13 Feb 2014 —

How to efficiently compare two maps of strings in C++

半腔热情 提交于 2019-11-29 23:21:56
I'm wondering if only by applying some standard algorithms is possible to write a short function which compare two std::map<string, string> and returns true if all the key-value (but some) pairs are true. For example, these two maps should be evaluated as equal map<string,string> m1, m2; m1["A"]="1"; m2["A"]="1"; m1["B"]="2"; m2["B"]="2"; m1["X"]="30"; m2["X"]="340"; m1["Y"]="53"; m2["Y"]="0"; Suppose that the two maps have same size and all their elements must be pairwise compared except the value stored by the key "X" and key "Y". A first attempt would be a very inefficient double nested for

Assign ID to marker in leaflet

被刻印的时光 ゝ 提交于 2019-11-29 21:47:27
So i try to achieve a result as on foursquare: https://foursquare.com/explore?cat=drinks&mode=url&near=Paris which is when you clik on a marker on the map, it scrolls through the listed of restaurants on the right -hand side of the screen to the ad hoc restaurant, and highlights it through CSS. Conversely, when you click on the restaurant on the list, it highlights it on the map. I am using skobbler/leaflet. I think I can achieve this by amending dynamically CSS as shown in this example: http://jsfiddle.net/gU4sw/7/ + a scroll to destination script already in place in the page. To achieve this

Detect if point in Latitude/Longitude based Polygon

微笑、不失礼 提交于 2019-11-29 21:46:45
问题 I'd like to detect, on the server side using C# only, whether a Latitude/Longitude based coordinate is within an area (polygon) made up of Latitude/Longitude based points. I believe the right way to do this is raycasting, but maybe there is already a C# implementation out there as it's not trivial? Also, I understand that SQL Server has some geometry function such as STIntersects but in order to use that I need both SQL Server 2008 running and every check would involve a database connection