Create Custom Markers - java

I want to add a lot more data to my Marker which I add to google maps using the Google Maps V2 for android. In objective-c I just subclassed the MKAnnotation class which is the Marker class in Android and added some extra Strings.
The Marker class however is final and thus cant be subclassed. Does anybody know how to add extra data to a google maps marker?
The extra data exist of extra Strings (like a website, address and city).

Related

Android Studio Google Map Eiffel Tower Place Type

I am making an application which shows the nearby places of a given location. I take the location name and place types like museum,place of worship est. from the user and show the locations from that given type.
My problem is, I can't get some special places like Eiffel Tower because there is no such type. How can I get these kind of places ?
And these are the supported types: https://developers.google.com/places/supported_types
You probably use Nearby Search Requests, try Text Search Requests with query=attractions instead and don't forget to specify location and radius.

Java - Multiple Destinations on Google Maps through URL

I am writing a program in Java that creates multiple destination points (latitude,longitude).
And I wish to add each destination as a marker on Google Maps.
The problem is, Google Maps doesn't allow more than 25 markers at a time.
At the moment I use I am creating a a URL string to represent the map, this is an example:
String url = "http://maps.google.com/maps?saddr=33.542550,-112.071399&daddr=33.538090,-112.047250+to:33.523892,-112.093669";
and then I call
java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));
to open google maps with 3 markers present.
When my string includes more than 25 destination points, it does not work since Google maps does not allow it.
Are there any ways around this? and possible make 50 markers in one map?
Create your own map with the Google Maps Javascript API that supports as many markers as you want. Beware however of URL length limitations.
Another option would be to create a KML file containing your markers with a unique name and use that to display the markers.

Google Maps Polyline to Postgis with Java/Hibernate

I have a page where the user enters the starting point and ending point and I show de route in the map. I would like to know how to get this polygon (polyline) and save it in Postgis through the Java / Hibernate.
Someone can help me?
Thanks.
Luciano
Usually you cannot get that polyline as vector data coordinates, because these data are provided either by Teleatlas / Tomtom (via Google service) or Microsoft Bing (Navteq data) or Nokia (Navteq data)
Such vector data are extremly expensive, and therfore you can only request that a line is drawn on the screen, but you will not get the geographical coordinates (latitude, longitude). Even Google would not have the right to give you that vector data (because they dont own that data, they only display it).
However, I remeber a post here showing how to use an unofficial Google server where you can request the route between two geo points, and get back a compressed encoded route.
But you legally cannot use that service, nor I do know if it yet exists.
An alternative would be use open source map data, like OpenStreetMap, for these services you can get the vector data for a route. For example: the ios RouteMe library provides such things via OpenStreetMap.

How to show multiple location markers using Google Map API?

Problem description:
I have to develop an application using Dynamic Google Map in Spring MVC to show multiple 'Bubble Markers' using address/postal code
and I have to show zooming facility for this map, when I click on that Bubble it have to show the corresponding address or postal code.
What I did yet :
I have implemented static Google map to show multiple 'Bubble markers' using postal code.
As following code
http://maps.google.com/maps/api/staticmap?center=099419&size=512x512&maptype=roadmap&sensor=false&markers=color:blue|label:S|416416|238843
One more problem with this static way, I can not put many postal code because of fixed length of URL.
so how can I implement this ?
follow this sample of goolge maps and make an array of marker.
Link
Or this:
Link2

Get route points on Android using mapquest

I'm using mapquest java library for Android. Actualy I have simple android application with map and I can determine route between two locations. The thing I need to do is to get geopoints of this route. The code below is from samples of mapquest.
routeManager.setRouteCallback(new RouteManager.RouteCallback() {
public void onSuccess(RouteResponse routeResponse) {
clearButton.setVisibility(View.VISIBLE);
if (showItineraryButton.getVisibility() == View.GONE &&
showMapButton.getVisibility() == View.GONE) {
showItineraryButton.setVisibility(View.VISIBLE);
}
createRouteButton.setEnabled(true);
}
});
The routeResponse object has a serviceResponse field of jsonObject type. One of the elements of this jsonObject is field called "shapePoints". The documentation of the RouteResponse sais that routeResponse field should have an array of geopoints pairs. I'm not getting this array, but some kind of hashed string :/ :
"shapePoints":"gvxpjAfxthgEkF?cQ]yQ?umA?qMOog#Oej#?u|Ak#qv#OcLOoHiBcGwD_IoHiCkAoCOmFN_DjAyBhBaBhC}JpR??gToS_b#}_#oIaHee#{`#k_#c[eo#se#ce#q\\iHsEgh#q\\}m#__#_i#uY_IeEyWgNav#}_#cjAum#s~#sf#{[eOc[kLiMeE{JwCgTsFmd#oIuwAkVwiHqoAux#wNgh#oIuYuEqMiBuJ{AyLyB}JyB_SeEmPeEuSsFka#{Lse#wMsPeFcLwCqjAm^ey#mUuiD{_Akp#aReTaGoSuE{[sGm_#uDku#sFyL}#eJ{#eJkAgJkA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CzEwMd#cG?cP?gc#?yk#{#kLcBcGVkK?kK?{`#??kB?"
Please help me with the funny shapePoints string, to get geopoints of the route. Maybe there is a different way to get those points. I was trying to google it for few days but without any bigger results ;/
The shapePoints string that you are seeing is actually a compressed format, so it is showing the shapePoints, but just not in a regular, readable raw format. The Android Maps API uses the MapQuest Directions Web Service for routing functions. The default routeResponse format in the Android API is cmp6, which is the compressed format that you are seeing, because it is generally more efficient to use the compressed format in an application.
You can tell the Directions Web Service to send the response back in a raw format by setting the shapeFormat parameter, which is included in the Directions Web Service documentation under the Advanced Routing Options section. Check out the Android Maps API Reference Guide for more specific information about setting the route options from within the Android Maps API -- look for the setOptions method on this page.
Also, just want to add that there is a Android Maps API forum on the MapQuest Developer Network and it is also a good resource to check when you have questions about the Android or other MapQuest APIs, like Flash, iOS, etc.
Please don't hesitate to ask if you need more assistance!

Categories

Resources