I want to remove Google Map UI elements and gestures. I just need users' current place as an image. User must not zoom_in, zoom_out or drag map etc.
I try two diffrent things :
1) editing source html (mainPage.html in my project) with new google map options like :
pre<code>
$("[name = 'map']").wrap("<div/>");
$("[name = 'map']").parent().css("margin-left", $("[name = 'map']").css("margin-left"));
$("[name = 'map']").parent().css("margin-right", $("[name = 'map']").css("margin-right"));
$("[name = 'map']").css("margin-left", '0');
$("[name = 'map']").css("margin-right", '0');
Code: Select all
var map_options = {
markerSourceName: "map_markers",
latitude: "",
longitude: "",
address: "",
zoom: 20,
showLocationMarker: false,
disableDefaultUI : true,
disableDoubleClickZoom : true,
draggable : false,
keyboardShortcuts : false,
mapTypeControl : false,
mapMaker : false,
overviewMapControl : false,
panControl : false,
rotateControl : false,
scaleControl : false,
scrollwheel : false,
streetViewControl : false,
zoomControl : false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
Appery.__registerComponent('map', new Appery.TiggziMapComponent("map", map_options));
$("[name='map_markers'] [apperytype='marker']").attr("reRender", "map");
$("[name='map']").closest("[data-role='page']").bind({
pageshow: function() {
if (Appery('map') != undefined) {
Appery('map').refresh();
}
}
});
/pre
2) adding buton and click event js like:
pre<code>
var map = Appery('map');
map.setOptions({ disableDefaultUI : true, disableDoubleClickZoom : true, draggable : false, keyboardShortcuts : false, mapTypeControl : false, mapMaker : false, overviewMapControl : false, panControl : false, rotateControl : false, scaleControl : false, scrollwheel : false, streetViewControl : false, zoomControl : false, });
map.refresh();
/pre
Both of these failed. Google map UI buttons can be removed. Gestures still working; zooming map.