jVectorMap - How to get County maps for US states? - asp.net

I am creating a control to be used in a DNN site that will display the US map using jVectoMap.
When I click Colorado I need the state map to appear with the counties defined.
Eventually I would like to have all of the US states but Colorado is critical right now.
I have tried running different Shape files through the converter as documented on the website but so far I haven't been able to get the counties. I have also contacted the developer three days ago now but have yet to hear back.
Unfortunately I am on a deadline for this and don't have anymore time to waste trying and failing.
Does anybody have a Colorado map with the county lines that is copyright free to use? Or is somebody willing to make one($-PM me)?
Any help is appreciated, thanks.
BTW if there is another library out there that has the US and state county maps available, I'm not married to jVectorMap.

I fixed this problem for all states by downloading the full project for jvectormap - http://jvectormap.com/download/
and under /tests/assets/us the author includes all the js files needed. Just copy them over to your project and use:
new jvm.MultiMap({
container: $('.jvectormap-container'),
maxLevel: 1,
main: {
map: 'us_lcc_en'
},
mapUrlByCode: function(code, multiMap){
return '../js/counties/jquery-jvectormap-data-'+
code.toLowerCase()+'-'+
multiMap.defaultProjection+'-en.js';
}
});
and it will load each of the county maps on demand

How I solved this:
First use this site to find a .svg of the map you need:
http://commons.wikimedia.org/wiki/File:Blank_map_of_Colorado.svg
Majority of these maps are free to use however you see fit. Just read the terms to be sure.
Then open the .svg with notepad/notepad++ etc. and paste everything to this site:
http://svgto.jvectormap.com/
After you paste, hit 'Convert to map' and on the next page you will be able to create the Names (which show up on the hover labels for jVectorMap) and the IDs.
Hope this helps

Related

Spectate league of legends game and retrive data

I want to code a script to retrieve data from league of legends game while spectating. I want to open the league of legends client, join a game as a spectator, then run the script, and the script collects all the game data, champ damage, gold etc and save that to a json file.then display that data nicely on a webpage and the gold and players damage as graphs.
Does riot games apis provide such a thing or if there's anything on GitHub I can use for this kinda job?
I didn't tried this, but I think LCU API can help you.
You can may open League of Legend client and join as a spectator with this.
But unfortunately, there is no official LCU API documentation, so you can see this documentation.
I hope I can help you.
There's an API for downloading the match timeline which is probably what you're after. There's no need to spectate a game to get it, you just need to register for an API key, and then you can download it using the match ID.
The way I was able to get around it is by using ocr to read the screen, I can grab anything that is displayed, but for damage currently there is no way. If you want a gold graph its best to make it yourself in python.

GraceNote - generate playlist with music of a given country

I would like to use GraceNote to generate play-lists which contain songs likely to appeal to, or, at least, be known to, residents of a given country. E.G, Japan, Korea, Turkey, Brazil, France ...
They don't necessarily have to be in the local language, as I don't think that I can do that with GraceNote (can I ?), but local artists would be nice. Is there any way, for instance, to query and generate a playlist using artist origin?
I realize that something like Gangnam Style might be known in most countries ;-) and that play-list generation is inexact when used this way, but I would be happy with a 70 or 80% "I know that song" reaction.
Can it be done? If so, how? #cweichen, can you help?
It seems likely you are referring the the Rhythm API. As you probably can see from the function definition, you cannot create a playlist using 'ARTIST_ORIGIN'.
The closest thing I can think of is creating a playlist (aka radio station) using on a popular song in the given country as a seed.
You may try configuring the 'focus_similarity' value to get a wider variety of songs. This is just a suggestion and I am not sure if this will get you what your looking for.
*Pygn currently does not support 'focus_similarity' configuration but it should not be too difficult to add yourself.

GTFS/NextBus/Google Maps - transit distance traveled

I am trying to get the distance traveled on a transit route -- particularly San Francisco MUNI, but the standards NextBus, GTFS, and Google Maps API appear to be universal. I'm comfortable using any of these APIs, I'm just not sure how to go about this problem.
The easy way - ask Google Maps (this using webservices, but there is also the javascript API):
http://maps.googleapis.com/maps/api/directions/json?origin=37.7954199,-122.397&destination=37.7873299,-122.44691&sensor=false&mode=transit&departure_time=1348109609&alternatives=true
this JSON includes distance traveled, but there are two issues:
Google does not allow you to use this data unless you're displaying a map, which I don't want to do
I would need to ensure that the distance returned is for the correct route/line, since it can/will give multiple routing options. This is probably doable but would require more logic.
EDIT: using alternatives=true (or provideRouteAlternatives: true using the javascript API) only returns a maximum of 3 routes, which here in SF often doesn't include the route I'm looking for (other transit agencies, multiple lines on the same route, etc). So this isn't such a great option.
NextBus:
example route config:
http://webservices.nextbus.com/service/publicXMLFeed?command=routeConfig&a=sf-muni&r=1
The coordinates for each stop are given, but connecting the dots on those is not the same as the route taken -- it will cut corners, etc, and I need this to be accurate. The actual route taken is given under <path>/<point>, but I don't see any obvious correlation between stop and path coordinates. Plus, NextBus says in their documentation (p.10 near the bottom) that you should NOT connect points between <path> segments, they're only meant for drawing on a map and can overlap.
GTFS:
The GTFS data also separates stop and "shape" coordinates (like NextBus paths). Unfortunately, the coordinates are slightly different for the same stops between NextBus and GTFS (rounding), though the stop ID/tags are the same. Also, the data files are in the megabytes, and I need to use this for a mobile app. I suppose I could put all the data in a database and query that, but that still leaves figuring out how to correlate the stops with the shape. The "shapes_distance_traveled" column in the shapes.txt file is especially promising. MUNI chooses to leave the optional "shapes_distance_traveled" field out of stop_times.txt, though.
Any advice would be appreciated, I understand this seems like an epic task to get a simple value. Maybe I'll just throw a map in to legitimately use the distance :)
Instead of using Google Maps, I would look into the un-encumbered licensing of OpenStreetMap. There are multiple
routing engines that can use OSM data. Personally, I would use routing in PostGIS or SQLite, but depending on your skillset you might choose another.
You've clearly done your research, (+1), and as you said, the easy way is to ask Google. If it is worth for you then you might want to look into purchasing a business licence to use the Google Maps API, and negotiate with them about the requirement of displaying a map. That's the only legal way I can think of with the Google API. Alternatively, you can try building you own routing engine with data from the TIGER data set, which is freely available from the US Census Bureau, but again, as you said, it may seem like an epic task. :-)

How to modify weather information displayed on google map

I have created a google map displaying markers and the weather layer using Google Maps API V3.
The weather layer is great for displaying weather information at well-known locations; however, for my map I only care about the wind speed rather than the forecast (ex. sunny, rainy, etc). Is there any way to modify the weather layer so that it displays "wind: s 5m/s" directly on the map instead of the sun/rain icon?
I realize that you can click on the icon to get the wind information but given that we do not care about the actual weather, we do not want people to have to click to get that. Instead we want the wind displayed directly.
(If it is not possible, then any alternative suggestions would be greatly appreciated as well :) )
I made a Weather API available on mashape, and they have a ready to use simple PHP SDK.
This api is really simple to use because we use the cool standards that are available nowadays, like JSON and REST.
If you like it please give it a try on mashape
I've tried but haven't found a way to change how the weather icons look when they are loaded.
It is possible (as you may know) to create a custom overlay using discrete weather data items (like wind speed) when a weather icon is clicked but that wouldn't seem to solve your problem.
See" "google.maps.weather.WeatherConditions object specification" in the V3 API reference
Like many of these kinds of things, I imagine it is theoretically possible to scan the DOM, find the weather 'markers', extract the info you want and redraw them as you wish them to look, but you may (unsure about this) find that the weather icons are actually images and data like wind speed doesn't actually exist in the DOM until the weather icon is clicked: The discrete data may be the product of an ajax load in response to the click event. Even if you got a DOM crawler to work it could be broken by a new release of the API and you'd never know what hit you.
Best bet may be to submit a change request to the API developers asking for the ability to format the weather icons and specify their content.
or
Use some other online source of json or xml weather data and create your own weather markers, labels, or whatever on your map.
Sorry I can't provide a more constructive answer :-(

Google has started highlighting search areas in Pink color. Is this feature available in Google Maps API 3?

Since Jan 2012, Google has started highlighting search areas in pick color. See the details here:
http://googlesystem.blogspot.in/2012/01/highlight-areas-in-google-maps.html
Does anyone know if this can be programmatically done using google maps API 3? I would want to show my cities in the map highlighted as shown in the link above.
I have already tried the Geocode API where I search for a city. That API only gives me the lat and long information. It does not help me in plotting the city boundaries.
No. It's not available in the API.
(It may be available in the future. Features of Google Maps do migrate into the API, but Google don't make announcements in advance and no-one has a crystal ball.)
You would need to find the city boundaries and draw the line yourself. Boundary data is almost certainly public-domain for the US. Other jurisdictions may not be so forthcoming.
Although a very old post my answer might help somebody out there as am landing on this post every time I query for bounding box:
Yes we can get the bounding box coordinates that google is using to highlight a region using Googles geocoding service. check for the response of the API call in the below sample from Google.
https://developers.google.com/maps/documentation/javascript/examples/geocoding-simple?refresh=1

Resources