Page 1 of 1

Lock position on google map

Posted: Wed Jun 18, 2014 10:36 am
by Bad Addy

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


Lock position on google map

Posted: Wed Jun 18, 2014 11:38 am
by Evgene Karachevtsev

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


Lock position on google map

Posted: Wed Jun 18, 2014 11:54 am
by Bad Addy

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');


Lock position on google map

Posted: Wed Jun 18, 2014 12:00 pm
by Bad Addy

I tried this:

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

but got an error about the object not being a function


Lock position on google map

Posted: Thu Jun 19, 2014 9:15 am
by Evgene Karachevtsev

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)