N
N
Nikolay2016-08-31 19:00:23
Google
Nikolay, 2016-08-31 19:00:23

Google API maps how to set a constant?

There is an example of building a map with autocomplete - how to set a static origin address?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikolay, 2016-08-31
@zzzmaikzzz

directionsService.route({
origin: {'placeId': "ChIJq6qqWiSsEmsRJuIpepyEua4"}

P
Philipp, 2016-08-31
@zoonman

If you look at the example, then you need to know the placeId for the starting point.

// вместо place.place_id вам нужно захардкодить какой-нибудь идентификатор
    origin_place_id = place.place_id; // например  origin_place_id = "ChIJq6qqWiSsEmsRJuIpepyEua4"
    route(origin_place_id, destination_place_id, travel_mode,
          directionsService, directionsDisplay);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question