Working around 10 Maximum Waypoints in Embed Maps - google-maps-embed

I'm volunteering my time to write an html5 app for a local NPO that frequently delivers food. The app is fairly simple - a delivery volunteer comes to the center where they can download their delivery routes. They are then allowed to customize their routes (drag and drop) or to re-order waypoints for optimum delivery (e.g. finish near their house, their office, or back at the center using maps web service API).
Here's the problem. All of this is working beautifully using the google maps web api. However, the google embedded map (in an iframe) is only showing 10 waypoints, when the average route has 13. Furthermore, if a user clicks to see the larger map, it only shows 10 of the 13 stops they have.
According to the agreement, I need to display a google map, but only showing some of the stops would be confusing to the users.
Is there a way around this limit? Is it possible to manually build the route from javascript (based on the web api result) and still use the directions method in case a user clicks into the large maps and wants to print the full route.
I'm using the directions embed API:
googleurl/directions/?origin=XX&destination=XX&waypoints=XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX|XX&key=XXXXX

I never really found a workable solution, so instead of showing the route, I am attempting to add markers for the waypoints in numbered order. It accomplishes my intent, meets the gmaps agreement, and gives the user an overview of the route.
I'm using dburles:google-maps for meteor/react.
if(!this.isLoading){
Clients.find().forEach(function(document){
var map = GoogleMaps.maps['mymap'];
var marker = new google.maps.Marker({
draggable: true,
animation: google.maps.Animation.DROP,
position: new google.maps.LatLng(document.lat, document.lng),
map: map.instance,
id: document._id,
title: document.seq
})
});

Related

HTML Geolocation API on mobile sends different locations when I stay on the same spot

Hello:) I will appreciate very much a knowledge or the answer on the next question. I have a PWA with HTML Geolocation API. When I open the app in mobile browser or as an app from a home screen, the success callback of the "watchPosition" method gets called approximately every second or couple with new coordinates when I don't move phone at all. "getCurrentPosition" method also gives new coordinates. The radius of new coordinates is small, in the range of a house or so, but when I got a cell phone call and answered it, this range extended 4 houses ahead. I need to record accurate user's locations on mobile without internet connection of him. Does anyone know how to achieve this? Thank you very much.

Google Maps Free API for NGO project

I'm building a React app and I would like to use Maps. Google Maps and other Maps APIs have a charge and this project will be free for the community (just like an NGO) so no budget at all.
In this app there is a page to create an Event, so you can type many things and where the Event will happen, and that is where I would like to use Maps, to search and show the location.
I thought that if is there any possibility to use a search box connected to an API just to get the Longitude and Latitude based on the search would be great, but I have no idea how to make it and I was expecting that you could help me find a way. (the thing is: get the information for free)
Just as I create this event, I would like to show this information on the Event page, so where the event will happen. And that would be the second part that I would like to use Maps. Do you know if I just show the location in Maps if I would be charged? If so, then I can use redirection to Google Maps using the Latitude and Longitude that I got from the event creation.
Thanks in advance!
See https://www.google.com/nonprofits/offerings/google-earth-and-maps/ for non-profit organizations.

How can i automate Google map image on web page?

I am not able to automate google map screen which is present on my application web page.
I have web page where google map is present in square in half of screen. I want to click on the road present in map or a restaurant logo which is present on the google map.
When i tried to find the locators for the map then in the DOM it is present as an image and no other html properties or locators are associated with it.
Also i tried an option using moveToElement() function of action class but this solution is not reliable as most of the time it is not working.
Please suggest me any solution for this automation issue if someone faced this issue of Google maps automation before ?
Sounds like HTML5 issue over a google maps issue. This is tricky for Selenium, see these articles:
https://www.linkedin.com/pulse/html-canvas-testing-selenium-opencv-maciej-kusz/
https://chariotsolutions.com/blog/post/automated-testing-of-html5-canvas/
which recommend using action chains to move to and click certain x,y coordinates.
Also, check out the canvas javascript api; you may be able to use javascript_executor to manipulate the canvas.

Is it possible to get Arrival/Destination Time from Google Map App

I am developing ionic application for Android. I want to open the Google Map App from my Application. Using launchnavigator,
launchnavigator.navigate([50.279306, -5.163158], {
start: "50.342847, -4.749904"
};
I can able to achieve this. Can anyone clarify my following doubts,
Is it possible to get the Arrival/Destination time from google Map App????
And also Is it possible to redirect to my App again???
Anyone Help will be Appreciated!!!
Is it possible to get the Arrival/Destination time from google Map App.
Launch navigator will launch a Google Map where you can see the starting point and destination point with direction connecting between those. So you can get the Arrival and Destination time from there if You Start the Navigate in the Google Maps.
FYI: if you select start point as null it will then take your current
location.
BUT: if you want the data of of arrival time into your App its not
possible due to Policy restriction.
And also Is it possible to redirect to my App again???
I don't know Exactly but if you click the back button it will redirect you again to your Application. Cause the Google Api started from your App in the first Place.

Cannot track google maps adsense earnings?

I have been using Adsense with Google Maps with my website from last few months now.
Am using the API as per-
https://developers.google.com/maps/documentation/javascript/advertising
However, when I wanted to check the gains I am making here, I could not see them in Adsense UI. I am using a 'BUTTON' ad unit and I fail to find any earnings under this ad unit size. I have decent amount of traffic with more than 1 million page views each month.
Can someone using Adsense with Google Maps help me find these earnings?
Regards,
To track your map AdUnit performance, you need to create a new custom channel in your AdSense account. Go to "My ads" tab and click "Custom channels" and then "New custom channel". Give your new channel a name and save it. Your will get a channel ID, say it is "123456789". The second step is to go to your javascript code where you add your map AdUnit. Add a new option channelNumber: '123456789' in your adUnitOptions. That's it.

Resources