@Martijn
Agreed, that would be even more efficient.
It will not be more efficient.
1/ The geocoding process require to ask on fly to a google server the translation Address => lat,lng. So this consume performances. It could be acceptable for few markers not for lot of markers.
2/ with an undetailed adress you can get several answers
Instead of having 2 lat and long TV’s, you can have only 1 have "address" TV
Gmaps use only one tv: LatLngTv. Not 2. And for the geocoding you usually need an address AND a latLng value. In this case the latLng is the point the closest of your address.
See the geocoding api
The GeocodeRequest object literal contains the following fields:
{
address: string,
latLng: LatLng,
bounds: LatLngBounds,
language: string,
region: string,
}
These fields are explained below.
address (required*) — The address which you want to geocode.
latLng (required*) — The LatLng for which you wish to obtain the closest, human-readable address.
bounds (optional) — The LatLngBounds within which to bias geocode results more prominently. (For more information see Viewport Biasing below.)
language (optional) — The language in which to return results.
region (optional) — The region code, specified as a IANA language region subtag. In most cases, these tags map directly to familiar ccTLD ("top-level domain") two-character values. (For more information see Region Code Biasing below.)
So, I probably add an addressTv. And the location of the marker will be deducted from the Address + latLng. But if the address is blank then I will use the latLngTV.
IMHO, for a map to show the location of one or two markers with an itinerary, for instance, I suggest that someone upgrade the
googleMapTv to the API V3. I think It will be more adapted than Gmaps.