How to use google maps api in angularjs to get list of cities between two markers (cities) - angularjs

I'm trying to show list of via point major cities when user enters/selects starting and end locations. I'm using angularjs and google maps api. Please let me know if this is possible or not?

What you're asking is most definitely possible, but not trivial. In addition to the google maps API, you will likely need to use another tool provided by google: their Places API.
This API would allow you to input a location and receive information about nearby landmarks, establishments, etc. The places API could be called from an Angular 1 service and then filtered or further manipulated to retrieve only results that are considered "major" to your users.
Depending on how accurate/specific you need your data to be, you should also consider using the American Census data API. You can compare the results from your google places API results and use real, accurate government data to check the population of regions or cities.
So to answer your question: Yes, it is most definitely possible although it certainly doesn't require Angular.

Related

Get live Exchange rates with coinbase api

I want to get live lists of all the exchange rates with Coinbase API. I realize that by using this: https://coinbase.com/api/v1/currencies/exchange_rates, I always get the same values, I guess these values change once per day. Is it possible to get live rates?
The simplest way to get nearly realtime data is to use one of the official or unofficial APIs. There exists a function you can use to receive the real time data you want. Coinbase API Reference
Edit 1: As an alternative, you can use the following links for receiving the Buy and Sell prices.
I don't know if this public API is as reliable as an authenticated access.
Edit 2: Even better: The spot price API Endpoint.

Data in database and google analytics does not match

Why are the counts I see in my database different than what I see in Google Analytics? The goal conversion number showing in Google Analytics is much lower than what I see in the database. This is the case for several months.
Few reasons here
Sampled data vs. unsampled data: You can read about here: https://support.google.com/analytics/answer/1042498?hl=en - For API work i normally use a web query explorer to verify that my API call's are being sent and responses match to verify the data: https://ga-dev-tools.appspot.com/explorer/
Adblockers: You might get hits/submissions from people where they are using an ad blocker, hence more entries in Database or Google Analytics.
Users vs. Sessions vs. Hits: You are looking at Unique Visitors/Sessions in Google Analytics instead of the total number of "Events", Not sure how your Goal is setup but best to use events and look at "Total Events" and "Unique Events" to get a sense.
Implementation: You may be firing JavaScript after the person has hit the button without waiting for the page change, can happen on some sites where you take them to a thank-you page or something. Best to check how this is setup and the order in which tag fires and page works.

Track user selected values on ecommerce(amazon.com) website (GAE Python) using Google Analytics API

I have designed an ecommerce website like amazon.com. I want to collect user analytics data on my website. I am still evaluating options and Google Analytics API looks good as it does not charge anything for a good amount of usage. And it should be fast.
What information do I want to collect about user behavior on my website:
What "dropdown" menu values do they select(say for narrowing down the exact product category)
What "checkboxes" do they select to filter out based on price range, size, type, or a specific feature
Which result entries(matched products) on the search page do they click
It would be good if I could get the time of day when the above happened
Also how long the user viewed a page (with an upper limit for cases when a user opens a tab and forgets to close it)
I hope the Google Analytics API has some feature to prepare charts based on the above data, as well as provide the average monthly values for the above counts
I decided to use an external Analytics tool since writing into NDB would take time, increase writes and increase the storage requirement
Any guidance is highly appreciated.. Anyone who has implemented similar analytics for their website, please share your advice..

Geocoding out of Salesforce.com (large number of static adresses)

We have developed an application in Salesforce.com to geocode and display account information (address information) on Google Maps within Salesforce.com. We have around 750k addresses for the initial (one-time) geocoding process (static address data), as we store the lat/lon with the account.
Is their any way to get this geocoded done in one 'batch' as we seem to hit the daily allowance of request per day (3k)?
Thanks for your support and feedback.
If you'd like to use Google to do this and you need to precompute the lat/lon coordinates, you'll need to upgrade to the Google Maps API for Business. The table on that link provides a detailed overview of the limit differences, and I suspect that the terms of use may also be more in line with what you're developing too.
If your goal is to create a Google Map from the addresses, you may also consider just passing the address data instead of the latitude and longitude. Their static maps will work fine as long as you know which locations that you'd like to use on the map, you don't have too many locations in one map and you don't need interactivity. Otherwise, you should use the javascript API and their documentation is very good for that.
If you don't know which locations you'd like to use on the map, you could use the lat/lon coordinates of their zip codes (which are freely available) to create a view port.
If you'd like a static map of the locations (whether or not you precompute the lat/lon), I'd recommend taking a look at the apexgooglestaticmap Github repository. It makes it quite easy to make certain types of static Google maps in APEX and VisualForce. Here's an example from that README:
APEX Controller
String[] homes = new String[]{'Albany, NY','Wellesley, MA','New York, NY','Pittsburgh, PA','01945','Ann Arbor, MI','Chicago, IL'};
GoogleStaticMap.MapPath moves = new GoogleStaticMap.MapPath(homes).color('0x000000ff');
String movesUrl = new GoogleStaticMap().addPath(moves).url;
Visualforce Page
<apex:image value="{!movesUrl}">
Google Maps URL and Image
https://maps.google.com/maps/api/staticmap?sensor=false&size=500x350&markers=label:0%7CAlbany%2C+NY&markers=label:1%7CWellesley%2C+MA&markers=label:2%7CNew+York%2C+NY&markers=label:3%7CPittsburgh%2C+PA&markers=label:4%7C01945&markers=label:5%7CAnn+Arbor%2C+MI&markers=label:6%7CChicago%2C+IL&markers=label:0%7CAlbany%2C+NY&markers=label:1%7CWellesley%2C+MA&markers=label:2%7CNew+York%2C+NY&markers=label:3%7CPittsburgh%2C+PA&markers=label:4%7C01945&markers=label:5%7CAnn+Arbor%2C+MI&markers=label:6%7CChicago%2C+IL&path=weight:5%7Ccolor:0x000000ff%7CAlbany%2C+NY%7CWellesley%2C+MA%7CNew+York%2C+NY%7CPittsburgh%2C+PA%7C01945%7CAnn+Arbor%2C+MI%7CChicago%2C+IL&
There are also many other geocoding APIs available. They each have their own terms of service, so make sure that your application matches the acceptable uses before you build anything with them. I've personally used PCMiler Web Services with success, and Geonames for reverse geocoding (they have a number of other great features too).
Google only allows that max per IP Address. If you were able to maximize the locations you were doing them from, max out at work, home or maybe your local starbucks, you could be able to hit the goal easily. If you have more than 250 employees just assign the 'homework' of going home and geocoding it! Spread the wealth, and the fun, of geocoding!
The other solution is using Google Maps API For Business, which allows you to do a max of 100,000 requests per day. For more information look at: http://code.google.com/apis/maps/documentation/geocoding/ ; for more information specifically on Geoogle Maps API For Business: http://code.google.com/apis/maps/documentation/business/index.html
I use this geocoder, and add my list and use yahoo to get the lat and long.
We have FindNearby installed, so once I get all the addresses geo-coded, I add them back into my excel worksheet in the respective column that has the Record ID. Since we use FindNearby, I have to add a column that is titled Mapping Status, and all cells under this say Located. I used ApexData loader to mass upload into SF. Note, geocoder has a limit of only 1000 records at a single "code" click, but it has no limit of how many lists you can process per day.
I changes some code to use Bing map services instead of google. There limits are based on keys and are much larger. Also when the key hits its max requests, then you can just get a new free key and apply it.

How do I get product information via Amazon's MWS API?

I'm trying to automate the addition to and management of our products on Amazon. Looking at the API documentation for the MWS API it doesn't look like there's a way to determine if a product has already been added to Amazon by another seller and if so what its attributes are.
We are building a new product database for all the products we sell and have a table specifically for Amazon attribute data fields (ASIN, etc.). If Product information is already on Amazon, we'd like to pull that data via API and store it to our own database as well.
If you attempt to add a product via CSV and that product already exists on Amazon (and your attributes are in any way different ("m" != "medium") you'll receive and error. In that case you can just piggy back that existing product information and just upload a CSV with your price and quantity for a particular ASIN/SKU/UPC. We'd like to do away with uploading CSV files and again, have our own product table for Amazon attributes.
Will I need to also leverage Amazon's Product Advertising API to determine this or can it be done via MWS?
The documentation for Amazon's APIs aren't exactly fantastic and it's been slow going trying to sort through it all.
We're working with Ruby.
Amazon's Merchant Web Services API is limited to your Merchant account. So the answer to your question is that yes you will need to use Amazon's Product Advertising API to get information about products that aren't already listed.
That being said you should be aware that there are new restrictions being placed on the Product Advertising API that will limit the number of calls that you can make on a daily basis to 2,000. In addition to this you will have to get an Associate ID that will be tied to your account and needs to be sent with any request.
Also, I find that the information collected using the Product Advertising API is sometimes out of sync with the site and have resorted to scraping the info from the site itself. This has more overhead but you can be assured that the data is current. Of course this is only useful if you already have an ASIN or are dealing strictly with books (which use the ISBN as an ASIN) or Music CDs (which I believe use the UPC as an ASIN).
The MWS Products API is where you will find this functionality. Specifically the GetMatchingProductForId operation.
http://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProductForId.html
(This API probably wasn't available at the time of the original question)

Resources