soda (socrata) NYPD Motor Vehicle Collisions API Cross-origin resource sharing - socrata

I'm trying to create a mashup using the NYPD Motor Vehicle Collisions API and Google Maps JavaScript API. I'd like to know if I can load data directly from the NYC API to the Maps API using Cross-origin resource sharing.

You can! Here are some more details: https://dev.socrata.com/docs/cors-and-jsonp.html

Related

Google Maps JavaScript API & Static Maps API Keys

We are using Google Maps JavaScript API and Static Maps API in our application. Currently we plan to go with the Standard plan and then enable the billing based on the usage in Production.
Just wanted to clarify if we can use the same API_KEY for both JavaScript API and Static Maps API. Are there any restrictions on whether API_KEY can be used only for JavaScript API or Static Maps API?
Regards,
Deepak
You can use the same API key for both Maps JavaScript API and Static Maps API. You can additionally set HTTP referer restrictions to the API key if you wish. Maybe if you use these APIs on different domains you might be interested in creation of separate keys on per domain basis for tracking purposes. Anyway this is your choice.

How do I provide API key when initializing Google Street View in JavaScript?

"Static" Street View documentation says that all request should have an API key added. There is also description how to add it. But looking at JavaScript SV documentation there is no mentioning of API keys. Is using API keys with "dynamic" SV required? How do I add them to my requests?
It is not required but you should according to Google:
All Maps API applications* should load the Maps API using an API key. Using an API key enables you to monitor your application's Maps API usage, and ensures that Google can contact you about your application if necessary. If your application's Maps API usage exceeds the Usage Limits, you must load the Maps API using an API key in order to purchase additional quota.
Here is the link on using the API Key

Using a business API key for reverse geocoding with Google

I'm working on a project that uses Google Maps APIs to reverse geocoding locations.
The customer is supposed to buy a licensed API key when rolling out to production.
Now I'm developing the application and I also need to test its functionality when using a valid, whether free or business, API key.
Let's pick a sample reverse geolocation request
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true
I have registered a developer account into https://code.google.com/apis/console/ and generated a server API key. Then I enabled Google Geolocation APIs and Google Maps API v3 (I think I need only the second).
When adding &key=XXX parameter to my previous request I get an error that the key is not valid.
Reading documentation with more attention, I discovered that the geolocation service I'm using is actually part of Maps Web Service APIs (Maps V3 APIs run on browser as Javascript). I tried to find those APIs into the Services list of my console but couldn't find anything more.
How do I use Google's reverse geocoding API with a business key for a project that will handle thousands of daily requests?
with no api key, the Google Geocoding API has the following limits in place: 2,500 requests per day.
Google Maps API for Business customers have higher limits: 100,000 requests per day.
to use to API for Business you have to use URL signing, see https://developers.google.com/maps/documentation/business/webservices/auth
NB: If you're switching from the free API services to a Maps API for Business implementation, you must remove the key parameter from your requests. Google Maps API web services will deny requests made with both a client ID and a key.

Using google maps api behind firewall

I have an application embedding google maps. Works fine. Some users are behind a firewall with very restricted access to the rest of the world.
Does anyone know of a valid list of dns-names/ip-addresses used by the google maps api? I can see what dns-names it loads from in firebug's net panel. But it feels a bit unsafe to use just them. Is there a such list that I can add to the firewalls whitelist?
..fredrik
EDIT
I spoke to someone who was working at the maps-team at google. And he said that it's not possible since the ip addresses changes since the maps service is split over a whole range over servers.
As I see in Chrome's console there are 3 servers that Google Maps are using right now:
mt0.google.com (ew-in-f100.1e100.net)
mt1.google.com (ew-in-f102.1e100.net)
maps.gstatic.com (ew-in-f104.1e100.net)
As you can see all of them are in 1e100.net domain.
1e100 equals1 googol ;)
This is possible now. The primary source of information is found here: https://developers.google.com/maps/documentation/business/articles/prelaunch_checklist#firewall
Configure Firewall to Allow Access to the Google Maps API Services
Why it's important: The Maps API services use a variety of domains, some which do not belong to the *google.com domain. If you are behind a restrictive firewall, it is important you understand which Maps API services use which domains.
Failure to allow access to the correct domains will cause API requests to fail, which can break your applications. For a complete listing of domains used by the Maps APIs, please consult our portal resource (login required):
Log in to the Google Enterprise Support Portal
The support portal is only available to Google Maps API for Work users.
Navigate to the "Resources" tab
Select the Resource called "List of domains used by the Google Maps API Family."
You should allow your applications to access these domains.
Please note that we do not recommend managing firewall restrictions by IP address, as the IPs associated with these domains are not static.
Here is the content of the article about domains used in Google Maps APIs. This article is available in Google Cloud support portal:
This document lists all the domains that are used by the Google Maps Platform when Maps components are loaded. This list of domain is provided to help you set up your firewall configuration, in case your Internet access is filtered by a per-domain policy.
Important notes:
This list is subject to change as new features are rolled out, and may not be up-to-date as new domains are noticed. It is recommended to check this page every 2 months.
The entries below containing google.com can be replaced with the other domains where Google Maps has launched: maps.google.co.uk, ditu.google.com, bendi.google.com, ditu.google.cn, bendi.google.cn, mapy.google.pl, etc.
Users accessing the API from China will send requests to domains under google.cn and gstatic.cn in addition to google.com and gstatic.com respectively.
Javascript Maps API (V2 and V3) over HTTP
The Maps Javascript API V3 (and V2) bootstrap and services (geocoding, driving directions, elevation, kml) use:
maps.google.com
maps.googleapis.com
Static dependencies:
maps.gstatic.com
Map tiles and traffic tiles:
maps.googleapis.com
Aerial tiles:
khmdb0.google.com
khmdb0.googleapis.com
khmdb1.google.com
khmdb1.googleapis.com
Satellite tiles:
khm.google.com
khm.googleapis.com
khm0.google.com
khm0.googleapis.com
khm1.google.com
khm1.googleapis.com
khms0.google.com
khms0.googleapis.com
khms1.google.com
khms1.googleapis.com
Streetview imagery:
geo0.ggpht.com
geo1.ggpht.com
geo2.ggpht.com
geo3.ggpht.com
lh3.ggpht.com
lh4.ggpht.com
lh5.ggpht.com
lh6.ggpht.com
cbk0.google.com
cbk0.googleapis.com
cbk1.google.com
cbk1.googleapis.com
cbk2.google.com
cbk2.googleapis.com
cbk3.google.com
cbk3.googleapis.com
lh3.googleusercontent.com
lh4.googleusercontent.com
lh5.googleusercontent.com
lh6.googleusercontent.com
Reporting requests:
gg.google.com
Identification requests:
id.google.com
Javascript Maps API (V2 and V3) over HTTPS
The Maps Javascript API V3 (and V2) bootstrap and services (geocoding, driving directions, elevation, kml) use:
maps-api-ssl.google.com
maps.googleapis.com
Static dependencies:
maps-api-ssl.google.com
maps.gstatic.com
Map tiles and traffic tiles:
maps.googleapis.com
Aerial tiles:
khmdb0.google.com
khmdb0.googleapis.com
khmdb1.google.com
khmdb1.googleapis.com
Satellite tiles:
khm.google.com
khm.googleapis.com
khm0.google.com
khm0.googleapis.com
khm1.google.com
khm1.googleapis.com
khms0.google.com
khms0.googleapis.com
khms1.google.com
khms1.googleapis.com
khms2.google.com
khms2.googleapis.com
khms3.google.com
khms3.googleapis.com
Streetview imagery:
geo0.ggpht.com
geo1.ggpht.com
geo2.ggpht.com
geo3.ggpht.com
lh3.ggpht.com
lh4.ggpht.com
lh5.ggpht.com
lh6.ggpht.com
cbks0.google.com
cbks0.googleapis.com
cbks1.google.com
cbks1.googleapis.com
cbks2.google.com
cbks2.googleapis.com
cbks3.google.com
cbks3.googleapis.com
lh3.googleusercontent.com
lh4.googleusercontent.com
lh5.googleusercontent.com
lh6.googleusercontent.com
Reporting requests:
gg.google.com
Identification requests are not sent.
Additional domains
You may also see the javascript v3 API access the following domains:
googleapis.l.google.com
clients.l.google.com
maps.l.google.com
mt.l.google.com
khm.l.google.com
csi.gstatic.com
Maps API Web Services
The Geocoding API V3 (and V2), the Directions API, the Elevation API, the Distance Matrix API, and the Static Maps API V2 (and V1) use:
Over HTTP:
maps.google.com (legacy)
maps.googleapis.com (recommended)
Over HTTPS:
maps-api-ssl.google.com (legacy)
maps.googleapis.com (recommended)
Maps Android SDK
The Maps Android SDK uses these domains over HTTPS:
clients4.google.com
www.google.com
csi.gstatic.com

Google map loading slowly

would it would help to have the apikey linked to an account that also has other Google services for the company associated with it, like Analytics, etc. also does the sensor variable speed up the call as well
If you are using the v2 API, you will need an API key from the Maps API Sign Up site. However note that the v2 API has been officially deprecated as of May 19, 2010, and you are encouraged to use the v3 API instead. The v3 API does not require an API key.
As for the sensor parameter, no, it will not make the map load faster.