Do I have to use a different Mapbox access token in every page / app? - leaflet

I'm developing a web application using NodeJS, OpenStreetMaps, Leaflet and Mapbox.
For a while I just use a home page and a register page, both with a map, using this code to display it. Very straight forward, as shown in
Leaflet Quick Start Guide
var map = L.map('map');
map.setView([19.34, -99.15], 12);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
attribution: 'Map data © OpenStreetMap contributors, CC-BY-SA, Imagery © Mapbox',
maxZoom: 18,
id: <myMapboxMapId>,
accessToken: <myMapboxAccessToken>
}).addTo(map);
I thought that I will use the same code for the entire app, till I add a new page with a map, got really frustrated that the map would not show up, no javascript warning or erros, checked lots of Stackoverflow questions and other forums, without answer.
I made that page a simple html with the leaflet js and css and it didn't show. Just a grey area.
So after a while, I went to Mapbox, create a new access token, place it and it worked.
What I find weird is that I was using the first token on two different pages, working perfect. But not with a third one.
So the question... Do I have to use a different Mapbox access token in every page / app? How does this work?
I've looked in the Mapbox documentation, without answers. Here Mapbox access token docs
Thanks!

No. You can use the same access token on every site if you want. But obviously they all share the same usage counts, so if you hit your limit, all the sites will stop working.

Related

Single Line Address for MapQuest

I'm trying to provide other map options besides just Google. Unfortunately a single HTTP query (e.g. location=123+main+street) only seems to be readily supported by Google.
I had no luck trying to find anything about embedding in the documentation and decided to email them directly:
The MapQuest business products
(https://developer.mapquest.com/documentation/) support both single
line input "location=1555+Blake+St+Denver+CO+80202+US" and the
advanced, 5-box method
("street=1555+Blake+St&city=Denver&state=CO&postalCode=80202&country=US").
Our API and SDK also lets you add the mapping/geocoding/routing
functions to your site without embedding links to the consumer site at
www.MapQuest.com.
Okay, so location=123+main+street should be supported in theory. However no example was provided. So using the iframe URL from the more client-oriented approach I tried the following without luck:
https://www.mapquest.com/embed/?location=1555+Blake+St+Denver+CO+80202+US
That just shows the map of the US as a whole.
How do I get the single HTTP query location to work for MapQuest embedding?
Correct: location=1555+Blake+St+Denver+CO+80202+US (single HTTP query).
Incorrect: street=1555+Blake+St&city=Denver (multiple HTTP queries).
It looks like a mix of MapQuest APIs and MapQuest.com. Check out the Link to MapQuest documentation. I think the Map a Location > Fielded Location is what you're after.
On this page: https://developer.mapquest.com/documentation/tools/link-to-mapquest/
Scroll down to Link to MapQuest Wizard.
Click on Map a Location.
Click on Single Line Location.
Click on the Run Sample with Embed View Specifier button.
Copy the URL from the new tab.
An example of the working MapQuest single HTTP query embedded page:
https://www.mapquest.com/embed/search/results?query=1555%20Blake%20St%20Denver%20CO%2080202&centerOnResults=1

Get capture date from mapbox satellite imagery

I am following the mapbox tutorial here. I have the static map displaying nicely inside of my web page. I would like to include a capture date on the image provided by map box.
I am using the mapbox.satellite mapId. So, my url looks like this:
https://api.mapbox.com/v4/mapbox.satellite/${lng},${lat},19/1000x700.jpg90?access_token=${accessToken}
My access token is provided by Digital Globe in a trial account. Does anyone know if the capture date is available, and if so, how to retrieve it?

Bing maps pushpins in REST

I am using bing maps REST services and I need to add pushpins but surprisingly it's giving me a hard time. I found out how to easily add pushpins in AJAX services, but that would need me to include scripts and stuff to my pages which I'd really rather skip. I tried searching the internet for information on how to add pushpins in REST ( or simply an iframe with a URL ) but I failed to find any useful such. Does anyone know how I can add pushpins in REST?
EDIT: I'm using dynamic maps based on this link http://www.bing.com/maps/embed/viewer.aspx?showCopyright=false&cp=43.835109710693~25.957630157471&lvl=1&w=250&h=350&sty=r
Assuming that you are using the Bing Maps Imagery REST service, you will be able to add pushpin based on the URL parameters, see the MSDN: http://msdn.microsoft.com/en-us/library/ff701724.aspx
Here is an sample request that will allow you to add pushpins, take a look at the pp parameter:
http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/47.619048,-122.35384/15?mapSize=500,500&pp=47.620495,-122.34931;21;AA&pp=47.619385,-122.351485;;AB&pp=47.616295,-122.3556;22&key=BingMapsKey
If you are using embedded maps, here is the list of parameters: http://msdn.microsoft.com/en-us/library/ee692180.aspx

Mapquest Open Aerial new tile server url?

The MapQuest page for open aerial api states that the url will be depreciated on Feb 15, 2013 and no longer work. The page does not list the new URL!!! Anyone know where to find this info? Mapquest?? anyone?
Alert:
The tile URL for the Open Aerial Tiles has changed. Please be aware that accessing
tiles through the oatile subdomain is deprecated and http://oatile1.mqcdn.com/
will be unavailable after February 15, 2013.
The new URL is listed further down on the page; basically oatile1 has changed to otile1, so that the URL is more consistent with URL used for the MapQuest Open Map Tiles.
Here's an example URL for an Open Aerial Tile:
http://otile1.mqcdn.com/tiles/1.0.0/sat/15/5240/12661.jpg
If you change ..../sat/... to .../map/... in the URL, you'll get the Open Map Tile for that specific area.

iphone: basic understanding of google map api

ok let me admit something that I am a little bit lost in here
Can any body suggest me some startup tutorial to get some idea about google map api.
I tried this url
"http://code.google.com/apis/maps/documentation/javascript/examples/map-geolocaton-iphone.html" as mentioned in google map api documentation
but this url has been moved I guess
so Please suggest me some tutorial with
1) show basic google map (not mapkit)
2) show pins on map
3) show multiple pins on map
4) When user clicks on these pins something get displayed in some subview
if you are building a native app then you can visit my blog post here for mapkit (its great!)
http://www.makebetterthings.com/blogs/iphone/add-maps-in-iphone-apps-mapkit/
if you are building a web based app and needs javascript / html tutorial then you can visit -
http://code.google.com/apis/maps/articles/yourfirstmap.html
http://econym.org.uk/gmap/