How does SimpleWeather JS know the location to display weather details? - weather-api

I am using http://simpleweatherjs.com/ SimpleWeather JS in my project for weather widget,
i want to know, how the JS know location to display weather details?
is there any kind of license to use it?

It looks like SimpleWeather has gone away, no longer exists.

it depends. one way is set your location by city / location name, like
loadWeather('Seattle','');
another is to use latitude and longitude, combined with a comma like
loadWeather('53.5688799,9.9761916');
you can also use javascript to get your geolocation data
navigator.geolocation.getCurrentPosition(function(position) {
loadWeather(position.coords.latitude+','+position.coords.longitude);
});
consider that user has to allow js to read its location.
see full demo at http://codepen.io/fleeting/pen/Idsaj
for what i read simpleweatherjs is under the MIT-LICENSE. but i am not sure about the yahoo weather api license it uses...

Related

Getting coodinates of a location by user tagging place in map

I'm using Mapbox GLJS with node.js for geolocating. But when a user adds a place Mapbox doesn't get that location right. So I'm looking for a feature of Mapbox, if it exists, that The user instead of typing the location in input, sees a map and tags that exact location in that minimap, and I get the coordinate of that location in the backend and do my stuff with that. Do you what I should do? Does Mapbox have that feature? It's like getting an Uber when you set the location of yourself and where you want to go.
Thanks
GL JS will include .lngLat info on pretty much any mouse events that fire. These example should give you a good idea of where to start:
https://docs.mapbox.com/mapbox-gl-js/example/mouse-position/
https://docs.mapbox.com/mapbox-gl-js/example/drag-a-point/
⚠️ disclaimer: I currently work at Mapbox ⚠️

Need Direction - Web Bot Creation

I want to create something that will look at a specific location on a website and read the value at this location. Then take that value and put it into a already created block of text.
What do I need to start researching to create something like that? Simple direction such as key words to Google and such would be extremely helpful.
Do you want to get the value from your own website or someone else's website?
If you want to get the value from an HTML element, you can easily do so using Javascript/jQuery.
If you are looking to write a script that parses the HTML from somebody else's website, you will need a HTML parser. If you plan to use Python, look into Beautiful Soup.

How can you create a search that will search within a KML and display the results on a Google Map v3?

I've created a Google map that loads a KML file as an overlay. It is a map of trailheads for say hiking. What I'm trying to figure out now is how to create a search that will allow visitors to search within the KML's data and show the relevant trailhead/s as results on the Google Map. Is this possible? I have a google search that will let them search for an address, but this does NOT search within the KML file's data for a trailhead.
Ideally the visitor could input an address, say 12345 Main st., Chicago, IL, or something and it would display results that are within a specified vicinity, say ten miles, of that address (ie latitude, longitude).
I'm a little lost as to even where to begin.
thanks for your help!
Davis
I don't know how often your kml file updates, but i recommend storing all the kml data in a database as well to make this easier. Maybe every once in a while re-download the kml file and update the database.
Then its as simple as using the haversine formula and searching the database for nearby trails.
What you're describing sounds like a good job for Fusion Tables. Fusion Tables give you a nice way to store and edit the data (even collaboratively). In addition, there are geospatial columns/data fields you can add (aka, a "Location" column that can be address or lat/long coordinates). Put all the trail heads in your fusion table and you can map them. Let people enter an address or lat/long, and you can query the fusion table to show all trail heads within the user specified distance of that point. See the tutorials to get started.
You can use KML search tool to do this. It supports KML KMZ CSV and GPX. You can find the tool here

Drawing Routes on Map using MapKit based on current location

In my application i want to draw Routes based on the current location moving, For Example If i am starting at a point and while i am moving the current location also navigates with me, I have to draw route along the way i am moving.
I saw some sample applications but in those apps the Lat and Long values are hardcoded. How can i do this, I want to draw the route dynamically along the moving of current app. Please give me any idea.
Thanks.
Apple supplied a demo application called Breadcrumb with the 2010 WWDC Developer videos that does exactly this. You can get the sample code from here: http://developer.apple.com/videos/wwdc/2010/

How would I best make this SEO_able?

I have a search engine that searches albums.
For each music album, I have a page.
So, the work flow goes like this:
People search for music titles
The search engine displays a list of albums.
People click on an album to go to a details page.
I want google to index my front page and the details page. I want the details page to be highly ranked. How can I build a sitemap for this?
By the way, I have about 5 million albums (but I want the top 1000 ones to be highly ranked on google)
You would not use a sitemap for that many results. You would want each album to appear as a page with a unique URI to reference that page. That way the search engine can crawl your site by crawling links since search bots cannot submit form data. Each of those URIs should be simple, meaning limited to this part of the URI syntax:
scheme://authority_segment/path
Program your web application to remove and throw away any extraneous data, such as query string or parameters. If you do this you have to be sure that you are watching for URI poisoning or SQL injection even through means of character encoding.
How can I build a sitemap for this?
By pulling the addresses out of your database and creating a XML file with a high priority for some selected pages. Somehow I think that isn’t your real question …
If I wanted to automate building a site map for a site like this, I'd employ Python. I'd pretty much write everything from the ground up (except the data store access). The format is quite simple.
I'm not sure I quite understand your question...

Resources