How to set the map type?
I created the map object and gave it the custom property of 'maptype' and give it any of the values google lists, but it does not change the default map type that loads.
What am I doing wrong?
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
I created the map object and gave it the custom property of 'maptype' and give it any of the values google lists, but it does not change the default map type that loads.
What am I doing wrong?
I found this suggestion: https://getsatisfaction.com/apperyio/topics/set_google_map_to_default_to_satellite_view_with_displayed?#reply_12220787
so I changed my refresh code on the success event to:
pre
var map = Appery('map');
map.options['address']='';
map.gmap.mapTypeId = google.maps.MapTypeId.SATELLITE;
map.refresh();
/pre
Now I see the satellite image flash before it's replaced with the default.
Hello Michael,
This can be done with JS:
pre
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(Appery("mapName").get(0), mapOptions);
/pre
Is it required to use the center and zoom params with? I currently have latitude and longitude mapped directly from the return to the map object.
Thanks Alena,
I got your suggestion working by just changing my approach a little...
pre
var mapOptions = {
center: new google.maps.LatLng(localStorage.getItem("lat"), localStorage.getItem("long")),
zoom: 6,
mapTypeId: google.maps.MapTypeId.SATELLITE
};
var map = new google.maps.Map(Appery("map").get(0), mapOptions);
map.options['address']='';
map.gmap.mapTypeId = google.maps.MapTypeId.SATELLITE;
map.refresh();
/pre
Thanks!