maps

Can you recommend a mapping API for commercial use?

强颜欢笑 提交于 2019-12-01 04:23:48
The requirements I have have to do with being able to print routes between many nodes, be able to query the distances between nodes for best possible route calculation and to show custom icons on the maps. It is important to have a mapping source which is accurate as far as roads and streets are concerned. I have investigated open street maps, but i am afraid that it may not be entirely accurate. Any suggestion of commercial library/API would be appreciated (as long as it's intuitive to use and does not lock you in functionality wise) I started off with Google Maps API for investigative

Google Maps infoWindow without marker?

筅森魡賤 提交于 2019-12-01 03:53:59
问题 According to the documention a marker is optional with an infoWindow, so how is this achieved please? I have tried infowindow.open(map) and infowindow.open(map,null) but both produce nothing. 回答1: infowindow.open(map) makes no sense since you need to specify the position where the infowindow should open, also it has a tapered stem which specifies the location where it should point. According to the documentation of Infowindows- InfoWindows may be attached to either Marker objects (in which

Leaflet: Add a link to the markers

浪尽此生 提交于 2019-12-01 03:45:25
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. Okay, I finally came to a solution; when a marker is added to the map it gets assigned an ID called "

When pattern matching maps in Erlang, why is this variable unbound?

半腔热情 提交于 2019-12-01 03:17:36
问题 -module(count). -export([count/1]). count(L) when is_list(L) -> do_count(L, #{}); count(_) -> error(badarg). do_count([], Acc) -> Acc; do_count([H|T], #{}) -> do_count(T, #{ H => 1 }); do_count([H|T], Acc = #{ H := C }) -> do_count(T, Acc#{ H := C + 1}); do_count([H|T], Acc) -> do_count(T, Acc#{ H => 1 }). In this example, the third clause where the map key "H" exists and has a count associated with it, will not compile. The compiler complains: count.erl:11: variable 'H' is unbound Why is H

Golang: convert slices into map

怎甘沉沦 提交于 2019-12-01 03:05:49
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 main() { var elements []string var elementMap map[string]string elements = []string{"abc", "def", "fgi"

How to send a LatLng instance to new intent

天大地大妈咪最大 提交于 2019-12-01 02:39:55
问题 I need to pass an instance of the LatLng class to another intent. How should I do it? Here's the code. LatLng fromPosition = new LatLng(23.4555453556, 11.145315551); LatLng toPosition = new LatLng(12.1115145311, 99.333455333); Intent i= new Intent(Maps.this, Routes.class); startActivity(i); Please help me out here. Route class: public class Routes extends FragmentActivity { GoogleMap mMap; GMapV2Direction md; private String provider; double lati; double longi; String name; Location location;

Can you recommend a mapping API for commercial use?

拈花ヽ惹草 提交于 2019-12-01 02:33:47
问题 The requirements I have have to do with being able to print routes between many nodes, be able to query the distances between nodes for best possible route calculation and to show custom icons on the maps. It is important to have a mapping source which is accurate as far as roads and streets are concerned. I have investigated open street maps, but i am afraid that it may not be entirely accurate. Any suggestion of commercial library/API would be appreciated (as long as it's intuitive to use

setting breaks and labels in ggplot

你说的曾经没有我的故事 提交于 2019-12-01 02:23:05
问题 I have put together the Shiny app (below), showing a choropleth, which looks good except for the scientific notation on the legend. I would like the values to read: '$5,000,000', and '$4,000,000', etc, etc. The code boils down to g <-choroplethr(DF, lod="state", num_buckets = 1) g <- g + scale_fill_gradient(high = "springgreen4", low= "grey90", name="Sum") I attempted this: g <- q + scale_fill_gradient(high = "springgreen4", low= "grey90", name="Sum", labels = c("5,000,000", "4,000,000", "3

Setting different fill colors for geoJSON objects in Google Maps API

≯℡__Kan透↙ 提交于 2019-12-01 02:22:17
问题 I created a map that has a data layer of geoJSON polygons on it. I have successfully set the fill color using maps.data.SetStyle. Now I want to create a different style for a certain set of polygons that I can identify through unique identifiers. The Google maps documentation uses .getProperty() but when I loop through the json object that created the data layer I am thrown ane error. Function is below: map.data.setStyle(function(jsonData){ for(var i = 0; i <= 516; i++){ var SD_NAME =jsonData

Adding custom marker text to Google Map

半世苍凉 提交于 2019-12-01 02:21:02
I'm creating a new website for new law office. I followed Google API for embedding maps. I added their address, but would like to add the name of the firm to the map... You can see in the map, it doesn't capture the name: <iframe width="600" height="450" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place?key=myapikey&q=883%20Farmington%20Avenue%2C%20Berlin%2C%20CT%2006037%2C%20United%20States"></iframe> So, I tried adding a name before the address in the iframe: q=Jill+Levin+Law,address here... But I'm guessing the keyword Levin pick ups a matching firm, Soulsby &