How to change view of google map -
i trying set google map view according needs unable do. want show google map this
but showing this
function init_map() { var var_location = new google.maps.latlng(33.6934473,35.644258); var var_mapoptions = { center: var_location, zoom: 12 }; var var_marker = new google.maps.marker({ position: var_location, map: var_map, title:"venice"}); var var_map = new google.maps.map(document.getelementbyid("map-container"), var_mapoptions); var_marker.setmap(var_map); } google.maps.event.adddomlistener(window, 'load', init_map);
any appreciated.
set center of map different location marker.
function init_map() { var var_location = new google.maps.latlng(33.6934473, 35.644258); var var_mapoptions = { center: new google.maps.latlng(33.691578, 35.523065), zoom: 12 }; var var_marker = new google.maps.marker({ position: var_location, map: var_map, title: "venice" }); var var_map = new google.maps.map(document.getelementbyid("map-container"), var_mapoptions); var_marker.setmap(var_map); } google.maps.event.adddomlistener(window, 'load', init_map);
html, body, #map-container { height: 200px; width: 100%; margin: 0px; padding: 0px }
<script src="https://maps.googleapis.com/maps/api/js"></script> <div id="center"></div> <div id="map-container"></div>
Comments
Post a Comment