maps

Golang: convert slices into map

醉酒当歌 提交于 2019-11-30 22:15:01
问题 Is there an easy/simple means of converting a slice into a map in Golang? Like converting an array into hash in perl is easy to do with simple assignment like %hash = @array this above will convert all the elements in the array into a hash, with keys being even-numbered index elements while the values will be odd-numbered index elements of the array. In my Go code, I have slices of string and would like to convert it into a map. I am wondering if there is a Go's library code to do this. func

How to replicate marker position on map loop Leaflet JS

心已入冬 提交于 2019-11-30 21:53:21
I'm using Leaflet JS to build a custom map (with custom tiles), it loops East to West. I've added a couple layers of markers and polygons (to indicate a route in the map) and each marker has pop up date within it. I want to duplicate the marker/polygon layers in the seemingly same position on the cloned map loops left and right of the original layer. var mapMinZoom = 2; var mapMaxZoom = 6; var tiles = L.tileLayer('../bigger_map/{z}/{x}/{y}.png', { unloadInvisibleTiles : false, reuseTiles : true, updateWhenIdle : false, continousWorld : true, noWrap: false }); var marker = L.marker([-110.25,

Google Maps API: Bézier curve polyline wrap

依然范特西╮ 提交于 2019-11-30 20:48:15
问题 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

Getting pixel coordinates of an image overlay using leaflet map library on click (right click)

妖精的绣舞 提交于 2019-11-30 19:28:40
I'm trying to get the pixel coordinates of an image overlay on click (right click/contextmenu) using the leaflet map library. Essentially when a user clicks on the image, I need to find the x,y or width,height of where the user clicked on the image. Currently this is what I have. // Using leaflet.js to pan and zoom a big image. // See also: http://kempe.net/blog/2014/06/14/leaflet-pan-zoom-image.html // create the slippy map var map = L.map('image-map', { minZoom: 1, maxZoom: 4, center: [0, 0], zoom: 1, crs: L.CRS.Simple, }); // dimensions of the image var w = 2000, h = 1500, url = 'http:/

Using the google maps api for reverse geocoding lat/long from iPhone

六月ゝ 毕业季﹏ 提交于 2019-11-30 19:27:31
问题 I am currently using the google maps' reverse geocoding API to convert long/lat received from an iPhone's CoreLocation API into city/state information on a google app engine server. Would this be considered a violation of the terms? I've done some research and cannot find a direct answer to this question. Right now, we will be distributing our iPhone app for free. 回答1: According to Google's Terms of Service, you can only use the geocoder in conjunction with a Google Map. You may not: use or

3D Extrusion with mapbox based on local geojson file

余生颓废 提交于 2019-11-30 18:04:23
问题 I have seen this example online which does data-driven building extrusion but doesn't provide the code at all. I would very much like to achieve the same thing. I have a geojson file with some kind of attribute that I would like to map onto the building's height. Would you know how that is possible? I have considered the recommended alternative: doing 3D extrusions on circles that are already generated based on my data. The code on this blog post is not provided and so I sued the code this SO

google maps height 100% of div parent

我是研究僧i 提交于 2019-11-30 17:58:01
问题 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? 回答1: reference: Mike

Android - Google Maps API v2 - SupportMapFragment Errors

人走茶凉 提交于 2019-11-30 17:37:19
I am trying to get one of my apps back up and running with the Google Maps API v2 for the first time. I created a key for my app in my keystore, extracted the SHA1 hash, acquired an API key, then did the following in-app... I included: google-play-services.jar as well as importing the GooglePlayServices libraryand adding it as a reference to the project. In my Java code I simply just load the layout resource. public class Times extends Activity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map); } } In the layout (res/layout/map

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

淺唱寂寞╮ 提交于 2019-11-30 16:57:27
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 iterators for maps! Mark Ransom Canonical? I can't claim that, but I'd suggest final_iter = someMap.end();

Android indoor directions with Google api

前提是你 提交于 2019-11-30 16:45:16
I currently have an app which displays a map fragment and can display navigation to a given point. The indoor maps is enabled and the building I'm trying to use does have indoor maps, but it only navigates to outside the building even when the transport mode is set to walking. Is there currently any way to do this? It seems that the Google Maps Android API does not support this feature for now. Even if you select the correct travel mode , which should be walking, the route is traced on the nearest road and not on the indoor path. I'm also waiting for this option to be released, since it is