Manually set Google Maps directions language - javascript

I am currently using the GMaps.JS, which displays directions based on the user's browser preference. Since I live in Latin America, where computers are usually setup in English, I was wondering if there is a way for me to forcibly make the Maps API use Spanish.

I was wondering if there is a way for me to forcibly make the Maps API
use Spanish.
Yes.
If you wish to change the Maps API to ignore the browser's language setting and force it to display information in a particular language, you can add an optional language parameter to the tag when including the Maps API javascript code, specifying the language to use.
For example, to display a Maps API application in Japanese, add &language=ja to the tag as shown below:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&language=ja">
Source: https://developers.google.com/maps/documentation/javascript/basics

Related

Implicitly select the language to translate page via Google Translate

I have seen those Google Translate options appear at many websites I visit, allowing to select the language and then the pages are automatically translated to that language.
[Screenshot]
Question in short:
How can I disable or choose languages from browser's in-built Google Tanslation tool?
Detailed Problem:
The Google Translate option selection dialog on mobile phones, it blocks some portion of my content from viewing to end user, . I have a web app (Next.js) project and I have some important buttons fixed at bottom of the screen. But whenever by site is visited, those button are getting covered with Google Translate leaving no clue that some content lies beneath it.
It's cool to allow selecting languages, but what if, instead of showing the Google Translate dialog box overlaying my content, I can add those language option on the navbar or somewhere in my web app itself, which can let users select the preferred language and translate my entire site accordingly?
I'm wondering if this is possible, via accessing any browser API or something? For example, my site is mainly based in India, so I need to have only 3 main languages as Marathi, Hindi and English. I can prompt users to select the language and then continue with same language on the entire website by telling the browser programmatically to select that language and translate all the pages, just like how Google Translate works but implicitly.
What I have looked for:
I have seen many questions on stackoverflow like these , which were asked almost 8 - 9 years ago, where in that period of time, there was a official tool provided by Google itself to translate sites. But, now it's discontinued because Google says:
We encourage users looking to translate webpages to use browsers that support translation natively.
But no additional information if a browser has Google Translation, we could access the translation tools via Browsers API or other methods.
you can add to your HTML code to disable that the browser translates automatically your application content:
If you want to suggest to your users different languages translation using buttons on your web app, then you can consider using google API Cloud Translation which will be triggered by a Cloud Function embedded with every button on your UI.

Reverse geocoding Google API without map javascript

I'm working on a function that takes from the javascript geolocation functionality the latitude and longitude of a certain place, puts those values inside a https://maps.googleapis.com/maps/api/geocode url and given a country and a specific time, redirects to a site or to another.
My question is, and i´ve really done tons of research. Can I do that?
This is why i´m asking.
In the ToS https://developers.google.com/maps/terms#section_10_4 says:
" No use of Content without a Google map. Unless the Maps APIs Documentation expressly permits you to do so, you will not use the Content in a Maps API Implementation without a corresponding Google map. For example, you may display Street View imagery without a corresponding Google map because the Maps APIs Documentation expressly permits this use. "
Also, am I to inform the user that i´m using such service? Because that it´s also amongst their ToS.
Thank u so much, I´m quite lost regarding that, because I don´t know if the page might get shut down if i use my function and dont put a map on the page nor if i dont alert of the use to the users.

jquery geolocation and map highlight

We are trying to add some visual statistics related to the visitors of our website.
We are now focusing on the visitors' locations.
We want to create a map (through a jquery plugin) that would:
a)Show the location of an entered IP on the map OR if the first option is not available, we could use geoIP to get the country/city of the visitor and the jquery plugin should just place a pin on the city given. It would be good if the plugin could allow us to place more pins.
b)Based on a list of IP's, sort them and group them by country and then highlight the countries with most visitors and color them based on the number of visitors, like Google Analytics. Alternatively, this can be done on server side through geoIP and the server could just output country-code:number-of-visitors and then the jquery plugin should just make the highlights.
What do I need to look for and do you know any jquery plugins that have such functionality?
Regards
I would advice you to use the google GEOCHART, it's free, easy to integrate and fairly easy to manipulate, so you can create your own maps. You can add colors, tags and many more.. .
I hope this is some of assistence to you.. .
There are a number of mapping options available, the key is translating your geolocation (lat and long) into pixels... presumably this would need to be done in real time, and updated on the fly as the visitor infomation changes. If you could link your Google Analytics to a .csv file, ten using a library such as D3.js would allow you flexibility to show anything you'd like. The toughest bit is to get the projection right. The seminal page everyone will refer you to is this:
http://bost.ocks.org/mike/map/
It explains how you would take a shape file, turn it into a json file, which essentially plots out the global or regional map for you.

Several questions about Google Maps Engine. Which version of engine? API?

I have a customer who wants a site with a map included. The requirements are as follows:
The map needs to be easily edited by the customer(which is why i ended up with Google maps).
The map needs to have markers with info about stores(which is why i think i need maps engine business, since its possibly money involved).
The site I'm making needs to have a search field, which should navigate to the correct location when a option (lets say New York) is selected(which i why i probably need to use the API).
Am i correct in the consumption's above? I'm very confused by all the developer guides, and different map options(lite, pro, engine, not engine etc). I keep opening new links, and they tell different things.
If i make my map public(which i can), will i still have to use OAuth 2.0? The guides i found said i didn't have to, but i still cant get info from the API. The response says i need to add the bearer.
More questions:
- Why can't i add markers when i use the "standard" maps engine, but only the lite one? I'm guessing the lite version wont be suffice for my project. The icons for adding marker is grey, and it gives me warning icon when hovering with my mouse.
- If i navigate to my map with the lite version i can't see my map-id in the url(this might be because it cant be used for API?). It seems i can get my map-id from the "real" maps engine.
Google has three products in this field: Maps Engine Lite, Maps Engine Pro, and just plain Maps Engine. This page explains the differences, but it sounds like you would be best off with Maps Engine Pro.
Both Lite and Pro let you embed your map easily into another webpage. No programming, OAuth etc needed, just copy and paste the pregenerated code.
Pro lets you add up to 2,000 points per layer onto a map, with full custom styling. (Lite is limited to 100 per layer and a set of default icons.)
Lite is free, but Pro costs only US$5/month, so it's not going to break the bank.
The only issue is going to be that search box. Maps Engine Lite & Pro maps in the default standalone viewer have a search box that does what you want, but the embedded iframe version only has a list of points. Might be good enough if you don't have too many?

Which Google Maps Option Should I Choose?

I'm currently working on a location-based app and I'm not sure whether I should use the Google Maps API for Javascript or the Google Places Web Service. For argument's sake, assume that both are technically feasible within the context of my app. Given that, what are the pros/cons of each? Is there a reason to use one over the other?
Thanks.
Assuming that this is what your talking about (for the web service portion) http://code.google.com/apis/maps/documentation/places/.
It appears that the Google Places API is meant to be used in addition to, but not exclusive of, the Google Maps API.
Usage Limits
Note: the Places API may only be used in conjunction with displaying results on a Google map; using Place data without displaying a map for which Place data was requested is prohibited. Additionally, calculation of Place information may generate copyrights, warnings and/or advertising which must be displayed to the user in some fashion.
So I'm not sure you can use one without the other.

Categories

Resources