here maps - showing places through entire route - javascript

I am facing one problem in HERE corridor api. If I search for long route and there are so many restaurants at one place on route, then it gives max of 1000 records at the same place.
So is there any way that I can get maximum of say 10 records at each place, so that I can get places all over the route?
I have tried width of the route with the category filter set as 'restaurant', now the problem with this is when we search for longer distances there are just too many records for restaurants and the response only returns all the restaurants around the source only and not all along the way till the destination.
I understand that this could be a practical limitation given the number of records for a given category, but would like to know if there are any workarounds at all for this problem.
Basically, I want to get places all over the route.
Thank you so much for your help.

Please refer the link below
https://places.cit.api.here.com/places/v1/browse/by-corridor?route=%5B18.9386%2C72.8242%7C15.48%2C73.8061%5D%3Bw%3D10000&cat=petrol-station&size=500&app_id={app_id}&app_code={app_code}
do not forget to add your app id and code, sorry I cannot comment hence posted it here.

Related

Google Maps API Marker Limit / Roll Off [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am working with the Google Maps Javascript API. I have 793 points with some associated information in a MySQL table. This morning I added 303 points to reach the current total. There are now three data "sources" by which I am color coding the markers. This morning prior to adding the additional markers there were only two data sources and all points (490) were apparently being mapped. (this is apparently still true if I select only points matching first two sources)
I have confirmed XML output exists from the PHP data-fetching sub-page for all 793 points including the corresponding source information. The problem is that the first data source points are no longer appearing.
If I select random points and limit them to 500, then all three colors appear in approximately the appropriate distributions, but when I remove the limit there are no markers for the first data source anymore.
Weirder still it seems like the first points are falling off when I don't randomize but do limit the results. In that case, the proportions of colors bias toward the second and third source points until there are no more points from the first source.
I cannot find evidence of a limit for the number of markers that can be displayed using the Javascript API (although I do know I am approaching the reasonable marker display density in some neighborhoods, that is not my concern yet).
Similar question: how to raise a marker limit in Google Maps? (Answers suggest there is no API limit)
FYI, I have not included any code because the code seems to be working correctly except for the roll off effect that appears to be attributable to the API. If you think I may be making an error in the code that is producing the described behavior I will edit my question to include additional information. Thank you.
Garbage in, garbage out: The data is bad, where is the bathroom?
Markers of each color show up when the data is randomly selected because it changes the data order. Without randomization, redundant points covered the first set of points making it appear as though there were no first data points. Randomized data randomly covered either the first or third color rather than only the first.
I wonder if I had posted the (working) code, would anyone have helped me figure out that the code wasn't the problem faster?
The MySQL query I used to determine the problem: select PropertyID, FormattedAddress, Latitude, Longitude, Source from MapData group by Source;
This produced three results, one from each source, at which point the redundancy was obvious. I will go back to the data compilation phase and correct it.

Google Maps API v2 for Android - Let user add marker or overlay of specific things they spotted

Thanks for reading this. I've just implemented the Google Maps API in my Android APP and it works perfectly. I've added markers of specific points of interest in the onCreate which also works fine. The next thing I need to do is give the user of the app the ability to add a marker or overlay if they see something on the route an this should be visible to all the other users using the app. The App is used to help people spot animals in a nature reserve by checking the app to see where animals was spotted by other users of the app. If possible i need these markers to disappear after let's say 2 hours as the animal will probably not be there anymore. My "setMyLocation is set to true and the app shows my current possition. Please help point me in the right direction as I'm not sure where to start or what to use for this. Your help is appreciated.
Thanks
Janno
What I would do:
Save the positions in a database. Add a colum timestamp to the table. In this timestamp you save the current time + 2 hours.
To get the right positions, Create a query which selects the positions where the timestamp is bigger than the current time.
It might be a nice idea to save what animal it is.
Good luck

Need advice on a database structure

A friend and I put together a MySQL php website where users can make predictions on sports events.
My question is regarding our "rankings" page which displays the list of members who have made the best predictions. The way we had it initially was each time a user loaded that page the server would calculate all the predictions from all the users, then displayed the top ones. Unfortunately, even with a small group alpha testing it, the loading of this page quickly became slower as the number of predictions grew.
Ideally speaking, we would like to have filters on this page, for each different sport, league and time frames, and create a dynamic rankings page, but we're stuck on finding an efficient way to structure our database that won't use up too much server resources.
Any ideas on what a better way could be is greatly appreciate. Thanks!
You could use "materialized views" to calculate the score. A materialized view is a view (thus some query), but where the results are stored (in memory) and updated accordingly:
http://www.fromdual.com/mysql-materialized-views
One can expect that the difference (in the number of (correct) predictions) will not change dramatically between two page renderings. Thus that the number of calculations will be quite low.

To show the route by clicking between two points on Google map in Blackberry

I am using JavaScript code to show the multiple pin points on Google Maps using Brownfield. I set the first clicked point as the center point, and when the user clicks on any other point (which is not the center point) I want to display a route mapped from the center point to that clicked point.
I would appreciate help of any sort, including ideas besides using JavaScript.
Google has a number of services available to people who program using their Maps. Go to https://developers.google.com/maps/documentation/javascript/reference and check out the directions services. I'm not very familiar with them, but I'm guessing it's similar to their other services. You make a directions request object supplied with point a and point b, and it will send a message to Google asking for the appropriate directions, which will be returned in some sort of result object that you can use to show the way. Update point b each time the user clicks and resend the google request, and it should update the path. Check out the API and it shouldn't be too hard to get it working. As for alternatives to javascript, Google Maps is written all in javascript, so there really is no other way. But I know from experience, most of their supplied code works really well, so I bet you can get it working!
Following link will show the route between two points:
J2ME/Android/BlackBerry - driving directions, route between two locations

How do I get more locations?

I am trying to get some locations in New York using FourSquare API using the following API call:
https://api.foursquare.com/v2/venues/search?ll=40.7,-74&limit=50
What I don't understand is that if the call imposes a limit of 50 search results (which is the maximum), how can I get more locations? When using Facebook API, the results being returned were random so I could issue multiple calls to get more results but FourSquare seems to be returning the same result set. Is there a good way to get more locations?
EDIT:
Ok. So there was a comment saying that I could be breaking a contractual agreement and I am not sure why this would be the case. I would gladly accept a reasoning for this. My doubt is this: Let us say that hypothetically, the location I am searching for is not in the 50 results returned? In that case, shouldn't there be a pagination mechanism somewhere?
The API docs here can help.
Foursquare searching is very closely linked to the location 'point' (the 'll' param on the query) that you provide. The simple answer is that to find more venues within a given area, you need to simply query again with a different location 'point' within that area.
Two queries, both at points close to one another:
https://api.foursquare.com/v2/venues/search?ll=40.700,-74.000&limit=50
https://api.foursquare.com/v2/venues/search?ll=40.705,-74.005&limit=50
will get you two different sets of venues (that may overlap, depending on how close the points are).
The default intent for the search method is 'checkin', which will return the 50 most popular locations closest to that point. If instead you want to look at all the venues within an area, you can use the 'browse' intent. This takes either a 'radius' parameter, in which case it returns venues inside a circle around the given point with the given radius, or it takes two coordinates representing the 'sw' and 'ne' corners of a rectangle. So, you could do:
https://api.foursquare.com/v2/venues/search?ll=40.705,-74.005&limit=50&intent=browse&radius=50
which will give you 50 venues within the 50m circle around that point. A smaller radius will reduce the number of venues returned. So, by varying the radius and the point at which you search (or the size and position of the rectangle described by the 'sw' and 'ne' parameters), you can get more venues returned.
Hope that helps.
The current API limits results to 50. You should try altering your coordinates to be more precise to avoid not finding your venue.
Pagination would be nice but 50 is a lot of venues for a search.

Categories