What do the Mapping APIs providers mean by 'transaction' or 'request'? - google-maps

I am developing a web app that is composed by :
a server-side : a Web API using ASP.NET 5
a client-side : a single page that contains a map in which are several pins (10.000 at least, gradually) that represent my client's POI
Here's my constraint :
The map will be integrated in the client's existing website, and since I will be using the Mapbox API (with the Leaflet library), I need to request the Mapbox server the least possible (free account/very limited usage).
I see that a lot of providers talk about requests and transactions, but I don't know what it really is.
Questions :
Can I load my map with 10.000 pins freely ? What is a transaction actually ?
When I load a map ? Is it a transaction ?
When I put 10 pins in the map, is it 1 transaction or 10 transactions ?

Mapbox's unit is a "Map View", which is defined as
A map view is four map tiles when using Mapbox Studio styles, or 15 smaller map tiles when using Mapbox Studio Classic or Mapbox Editor Classic. One Static API request also counts as one map view.
^ this is from the pricing page
Map tiles are the 'base' map - the styled streets, buildings, and other features that Mapbox provides as context for your data.
If you're adding markers or pins to your map on your side - adding them via Leaflet or some other method - those don't have any effect on transactions or pricing, since they don't need to be sent to Mapbox at all.
So for this use case: when you load a map, it's typically one map view, but if it's a very small map it could be less or if it's larger it could be more. Adding pins to the map doesn't affect transactions or cost.

Related

google maps api count

I'm trying to wrap my head around what counts against the API call quota.
I have a page with a map, the map has 5000 locations marked on it.
Does google count the 1 page load or the 5000 locations it marked on the map?
You can find the answer to this in the new documentation Understanding Billing for Maps, Routes, and Places
From the SKU: Dynamic Maps
A web page or application that displays a map using the Maps JavaScript API. A map is created with the google.maps.Map() class.
User interactions with the map, such as panning, zooming, or switching map layers, do not generate additional map loads.
This also mean that Drawing on the Map does not count as map load since it does not need to call the google.maps.Map() for each overlay.
However, if you are retrieving the latitude and longitude for a place or street address with Places Library or Geocoding Service to display the markers, then it means you are making a request using those APIs and will be charged separately.
If your Javascript Map instantiates a Street View, this will also be charged separately as per the documentation
In JavaScript, with the google.maps.StreetViewPanorama() class or Map.getStreetView() method (prior to the new pricing, Map.getStreetView() was not charged). Usage of the StreetViewService() class is not charged.
Hope this helped!

How to track multiple vehicles with Maps API

I'm working on new application in my workplace as described below:
We have tens trucks working for us. I've installed a GPS module on each of them to track their position and store their coordinates in a database.
I need to see their movements in real time on a map (Google Maps, or Bing Maps) but I don't know how to do this.
I don't want code or snippets, I prefer Guidelines and API Docs or framework to build it!
If you have any question ask without problem! Thanks guys
Since you have the data in a database, the first step would be to expose that data to your app. There are a couple of different ways to do this depending on the type of app you want to create, however the most universal solution would be to create a web service that any of your apps can connect to. Here are a couple of good blog post on how to create spatial web services.
http://blogs.bing.com/maps/2013/07/31/how-to-create-a-spatial-web-service-that-connects-a-database-to-bing-maps-using-ef5
http://blogs.bing.com/maps/2013/08/05/advance-spatial-queries-using-entity-framework-5
Once you have a web service you can then create the app that will display the truck locations. You have a lot of options here; web, mobile, desktop (WPF, Windows app), cross platform. Web apps tend to be the most common as they can be accessed from the most locations. Connecting to a REST service from JavaScript is fairly easy. There is a number of different ways to load in real time data. The easiest is to use a timer that calls your web service regularly and grabs all truck locations. A slightly more complex option, but more efficient is to timestamp the last update of each location and then keep track of the last timestamp used to request an update. By doing this you can limit your request to only retrieve updates that have occurred since the last request. This would significantly reduce your bandwidth and make your app faster. Displaying the actual truck location on a map is easy. Your web service will return the location information, likely as either two number properties (i.e. latitude/longitude) or as a well known text string (simply parse this as shown in the previous blog posts). If using Bing Maps and you have two number properties, you can create a pushpin and add it to the map like this:
var loc = new Microsoft.Maps.Location(latitude,longitude);
var pin = new Microsoft.Maps.Pushpin(loc);
map.entities.push(loc);
Here are some useful resources around developing with Bing Maps:
https://www.bingmapsportal.com/ISDK/AjaxV7
https://msdn.microsoft.com/en-us/library/dd877180.aspx
Note, if you use Bing or Google maps (or just about any other major mapping platform), they require all asset tracking applications to have a license to use the maps. If you use Bing Maps, you can find details on licensing here: https://www.microsoft.com/maps/licensing/licensing.aspx#mainTab4

Creating a Google Maps application

I have been behind the 8-ball all quarter for my class some how I am supposed to be able to do this in 4 hours.
My Assignment
The purpose of this assignment is to utilize a map to display a route using overlays/polylines.
The goal of this assignment is to enhance the assignment from week 5 (web service to retrieve directions) to display the retrieved directions as a route on a map in addition to a list of steps.
You are required to write a single application that runs on a tablet configuration (Nexus 10 or some variation of a 10 inch screen tablet)
User Interface Requirements
The left side of the screen (ListView, left-pane) will contain the interface outlined in the week 5 assignment. A user can enter a source and destination and retrieve a list of directions based on that input. So, the interface is a couple textfields, a button, and a list.
The right side of the screen (right-pane, details view) will contain a Map that displays the directions as a segmented line (route). The map and route gets updated/displayed after the directions are retrieved (selection of the button). An initial map should be displayed with some default settings when the screen is first loaded.
Other Requirements
The Map should display the entire route (start and end point) at the appropriate zoom level (depending on the distance). The correct map type should also be used depending on the distance.
You are required to use a Marker to display the starting point and ending destination.
You are required to use the MapFragment class.
You are required to use API V2 from Google Maps and the Google Play Services API.
You are required to use the XMLPullParser class for parsing the XML.
This application will look very similar to the Google maps application that is used on the web (with a lot less detail, no zooming in out of the map, etc), concerning the route displayed, and left pane to enter source / destination and direction list.
Using Android Studio I have tried Creating an Application using the Map Activity, but it creates and application that will not compile and it looks like it wants me to use Google Keys. I can't hand in an assignment that requires Keys assigned to me.
I already have 4 hours into this and I can't even get started. I read that v3 of googles map API's doesn't need keys, but I can't find anything that tells me how to use them and Android Studio Doesn't seem to give you options as to what to download and use.
I really need help.

Core Google Map API for J2ME

I am using http url to show map in J2ME application but it takes more time as it draws image on each refresh. since internet speed is bit slow in GPRS.
Is there any core Google Map API for J2ME??
Is com.jappit.midmaps.googlemaps.GoogleMaps is Authorized Google Map Library for J2ME Application??
Waiting for your reply.
Regards,
Parmanand
No, there is not a core Google Map API for J2ME. No, the Jappit library is not an official authorised product, though it was a good attempt a mapping library based on the technology available at the time.
The reason the update of the map is so slow in the Jappit library, is that the underlying static mapping service behind it is not well suited to refreshing and updating a dynamic map.
Every time the map is shifted or updated, an image the size of the screen is downloaded leading to a large amount of data traffic. A better solution can be found in using a map tile service, implement aggressive image caching and adding overlay objects on top of it. Basically doing everything to avoid downloading more images.
So in summary use a web service like the Static Maps API, if all you need is a single map image. Use a dedicated Java ME mapping library such as the HERE Maps API for Java ME if you want a responsive dynamic map.
As a notice of affiliation, I should mention that I do work for Nokia.

For Developing Location based reminder mobile app, which one is good..... Google Maps or Nokia maps

I am developing GPS based Location reminder in j2me. I am little bit confuse to which maps i use??.....Google maps & Nokia maps. Which one allows me good working... The working of my app are as follows :-
-User will provide a string to app to search a place of his/her desire.
-Then according to given string app will show a place on map by pointing marker on map.
-User can save that place or he/she can select a near by place rather than searched place by clicking on map or any other way.
-app will save that searched place coordinates & remind when it reached to near that place.
-When app remind to user about already stored place... that place should show on map by pointing an marker along with the how far he is from his destination.
The real choice here lies in whether to use a RESTful API like the Google Static Maps (or Nokia's RESTful Maps) or to use a native Java ME mapping library plugin such as the Nokia Maps API for Java ME. The latter has several major advantages:
Static mapping services such as the Google Static Maps API or Nokia's
RESTful Map API do not cache or tile the images when requested,
therefore each request involves a round trip to the server. If the
map on a mobile application needs to be refreshed at any time, using
a caching library will result in a reduction in network traffic after
around three maps have been displayed. An explanation of this can be
found here
As the name implies, Google's Static Maps API can only retrieve over
http static images for a requested coordinate point, image size,
image type and zoom level. Newer libraries offer additional
functionality out of the box offering dynamic Map content and touch
support, where the user can move around his/her current position,
zoom in, zoom out, modify the view mode to satellite or translate an
address to a coordinate point and show that on the map, among others.
This abstraction of the underlying functionality is hidden from the
developer so much less coding is needed in order to achieve the same
result .
Terms and Conditions for Nokia Maps are easier to fulfil than
Google - No legal restrictions of using the API outside a web browser
application or need to provide a link to the native Google Maps App
(if there is one), or to Google Maps (if there isn't one).
Nokia currently offer higher free daily request limits. Nokia Maps
API for Java ME supports up to 50,000 render requests per day and per
unique IP address (as of January 2012), for Nokia Developer
registered users (free of charge) while the limit for Google's Static
Maps API is currently 1000 unique (different) image requests per
viewer per day.
A couple of years ago there wouldn't be a choice, only RESTful solutions existed, but these days I would say a static http solution should only be used if you want a simple single image
As an abstraction of the underlying services, there are already a full set of examples to cover most of your use cases:
-User will provide a string to app to search a place of his/her desire.
-Then according to given string app will show a place on map by pointing marker on map.
http://www.developer.nokia.com/Commu...PI_for_Java_ME
-User can save that place or he/she can select a near by place rather than searched place by clicking on map or any other way.
Maybe you need to use a draggable marker:
http://www.developer.nokia.com/Devel...ples/#standard
Or react to the touch and find a Geocoordinate:
http://www.developer.nokia.com/Commu...PI_for_Java_ME
-app will save that searched place coordinates & remind when it reached to near that place.
This is known as geofencing and is covered by the Location API:
- http://www.developer.nokia.com/Resou...ty-events.html
-When app remind to user about already stored place... that place should show on map by pointing an marker along with the how far he is
from his destination.
Showing a Map with a Marker
http://www.developer.nokia.com/Devel...ples/#standard
For distance calculations, I guess you'd be after the ROUTING example
http://www.developer.nokia.com/Devel...mples/#routing
http://www.developer.nokia.com/Commu...g_with_Java_ME
Now you could re-write and all these services from scratch using RESTful APIs (and then go about debugging your code) , but I'm sure you'll agree it would be much easier to use an existing, working and tested framework for the low level plumbing and then just write your code on top using the services.
It is possible to encapsulate RESTful service in Java ME. As an example, added below is a screenshot from an app encapsulating the suggestion service
It is just a lot easier when someone else has already done this work for you and placed it in a library.