mapboxgl api access error : {"message":"Not Found"} - mapbox-gl-js

I'm using mapbox studio to produce custom map and accessing that style in js. but I'm not able to access that style when calling api. it simply returns with {"message":"Not Found"}
I can directly access the api link through mapbox studio. In mapbox studio in styles we have map style id and api link. so i can access it using that link but when I actually use in my application it's not working.
here is the code where I'm getting error:
map.addSource('parcels', {
"type": "vector",
"url": "mapbox://styles/ch*****/ci****************"
});
Hoping to get some good help.
thanks
Akshay

There are two potential causes for Not Found errors:
You are looking at an area of the map where there is no data. The Mapbox API responds with a 404 status code to indicate "no data" for vector tiles. These messages can be ignored. Try panning to an area where there is data.
You are using the wrong access token. Make sure you are using an access token from the account used to create the map. You can read more about Mapbox access tokens here https://www.mapbox.com/help/define-access-token

Related

Why does the Firebase API call for projects.databases.get return an error 404 - Project does not exist, for a project that does exist?

I'm new to all of this so I probably missed something really obvious.
When trying to run a simple test using the following API call :
https://firebase.google.com/docs/firestore/reference/rest/v1/projects.databases/get
the response that I get back is:
{
"error": {
"code": 404,
"message": "Project 'some-projectname' does not exist.",
"status": "NOT_FOUND"
}
}
But the project does exist (though the name actually used isn't what is shown here I removed that for privacy reasons). But none the less the actual project is visible in both the Google Cloud Platform UI and the Firebase UI.
To try and add more color and hopefully supply as much detail as possible.
I use the following format for the parameter:
projects/some-projectname/databases/some-databasename
and for Credentials, leave both boxes checked: "Google OAuth 2.0" and "API key".
The project is under the Blaze plan and was set up with Firestore in Native Mode.
Please let me know if there is any more detail I can supply or something I should try and thanks kindly for your time.
You need to use (default) as the database name as that's the name of the only database that is currently allowed for each project.
I.e. projects/PROJECT_NAME/databases/(default)

How to embed a public Mapbox style by using user's own access token

FCC provides a style id from their website which is
https://api.mapbox.com/styles/v1/fcc/ck07351k218h31cp7om3z4bka.html?fresh=true&title=true&access_token=pk.eyJ1IjoiZmNjIiwiYSI6ImNqY2h2MnAxbDJhZjIycXBnN3cxb3FnYzAifQ.-JIKXvGZ-ZI2m7L8f92Lew#3.0/37.000000/-95.000000/0
However, when I tried to embed the style into my website, it is not working.
My code is
mapboxgl.accessToken = 'myowntoken';
var map = new mapboxgl.Map({
container: "map",
style: "mapbox://styles/fcc/ck07351k218h31cp7om3z4bka",
center: [-121.064242, 36.922103], // starting position
zoom: 5
});
I wonder why this happened?
It's likely that FCC only allows using this style with their token. The note on their documentation website says:
Note: In order to access these layers, in the various formats below, you need a Mapbox access token. We are including a public access token in the links below since we want to make it easy for people to access broadband data in whatever format is most useful. However, if we find that the access token is being abused, and in particular being used to access maps unrelated to the broadband map, we will have no choice but to deactivate the token, and require end users to get their own token.
While it implies that you could use your own token, it seems like they didn't actually enable this functionality.
You can use the token they provided for the time being.

Got error on invoking the IBM Softlayer "getCpuMetricImage" rest API

I have an active IBM Softlayer account. I am getting the error as
{"error":"One of types passed is not in the proper container.",
"code":"SoftLayer_Exception_Metric_Tracking_Object_InvalidDataType"}
when trying to fetch the cpu metric image using the below rest API with valid Virtual_Guest_Id and Snapshot_Range":
"api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/<Virtual_Guest_Id>/getCpuMetricImage/<Snapshot_Range>"
But I am getting the proper response while fetching the memory metric image using the similar rest API listed below:
"api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/<Virtual_Guest_Id>/getMemoryMetricImage/<Snapshot_Range>"
First of all your REST request is wrong it should something like this:
POST https://$USERNAME:$APIKEY#api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/$VSIID/getCpuMetricImage
PAYLOAD:
{
"parameters": ["day","9/2/2017"]
}
Second the method is not working currently I am going to report it, but I do not have idea when they are going to fix it.
Another thing to point out is that the Softlayer's control portal do not use that method to display the graph, so is likely that the image returned by the method and the graph in the portal are going to be different. If you want the same inforamtion I recomend you to use the same method see this forum for more information:
SoftLayer API CPU usage mismatch
The method in the forum above will return you the data of the graph and then you are going to need to represent that information in a graph using your own code.
Regards

ESRI ArcGIS REST API URL giving me a blank image

I'm trying to use the following URL to export a map image and I'm not getting anything other than a blank image...
http://demographics6.arcgis.com/arcgis/rest/services/USA_Demographics_and_Boundaries_2016/MapServer/export?f=json&format=png&bbox=-82.728110%2C27.719379%2C-82.532320%2C27.816795&size=600,600&token=[my-token]
Any ideas?
Are you constructing this url yourself or is that request coming from a layer added to the map?
After logging in to ArcGIS Online, I was able to use the export endpoint just fine with this url:
http://demographics6.arcgis.com/arcgis/rest/services/USA_Demographics_and_Boundaries_2016/MapServer/export?bbox=-2.601910765504469E7%2C4619421.289780159%2C1199812.3691861853%2C1.6262309438175105E7&size=600%2C600&format=png&f=json
My hunch is you are supplying an invalid bounding box, it looks like it may be in a different spatial reference than the service, the service is expecting web mercator (102100) and looks like you may be giving it geographic (4326)

Bing maps: Direct Access to tiles and Api key

i am using Bing map tiles in my Android application. I download tiles from http://h0.ortho.tiles.virtualearth.net/tiles/h<quadkey>.jpeg?g=131 and it works fine, but i understand that i need to append a token to this URL in order to make this operation legal (and ask some kind of special permission from Microsoft). It is all well explained here: http://blogs.msdn.com/b/virtualearth/archive/2008/04/29/tracking-virtual-earth-tile-usage.aspx. But this post is from 2008 and i found on msdn site that in 2012, token-auth system will be replaced with key auth system.
Does anybody know how can i perform the direct tile access with this new auth system?
Thanks in advance
Accessing tiles directly with key-based authentication can be accomplished like so:
Using the REST ‘Get Imagery Metadata’ service to obtain the tile URL format for the type of tiles you wish to display:
http://msdn.microsoft.com/en-us/library/ff701716.aspx
- For example, if you wish to display Road tiles, the following request could be used (taken from the above documentation): http://dev.virtualearth.net/REST/V1/Imagery/Metadata/Road?mapVersion=v1&output=xml&key=BingMapsKey
Within the response, the URL for tiles is returned, with a placeholder for the tile quadkey.
A new REST request should be issued each time the map viewer in the application is instantiated, or whenever the map type is changed (eg. You wish to switch to aerial or hybrid map style)
Your platform usage can then be tracked based on the calls to the REST service.