Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Lock position on google map

I tried to lock the position of the map by adding the property:

draggable: false

but it did not work, so how do I lock the position of the map. I only want them to move around the map and marker, and zoom in on another screen.

Thanks

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Lock position on google map

Hello Addy,

Please detail how do you add this property? Should be like this:
Вот так должно работать:

codevar map = new google.maps.Map(document.getElementsByName("multiGoogleMap")[0], {
zoom: 5,
center: new google.maps.LatLng((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2),
draggable: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
});/code

where multiGoogleMap is the name of map component

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Lock position on google map

I added it to the component on the UI. I did not do any code.

The address is loaded via the database. How would I add this to the Add JS part in the mapping ?

$(this).prop('draggable', 'false');

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Lock position on google map

I tried this:

element.options({'draggable' : false});

but got an error about the object not being a function

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Lock position on google map

Addy,

Please clarify how are you going to add location from your DB?
Like in this tutorial:
http://devcenter.appery.io/tutorials/... ?
If the answer is yes, than you can add this property when map is initialized (step No13 in tutorial)

Return to “Issues”