5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

スマホでGoogleMapがあるとめちゃめちゃスクロールしづらい

Last updated at Posted at 2016-07-09

rage-face_2385836.jpg

draggable: false,

を有効にすると良いみたいです。

パソコン用に scrollwheel: falseも設定しておくとマウススクロールが無効化されるのでそちらはお好みで。

jQuery(document).ready(function() {
	var lat = 0;
	var lng = 0
	var latlng = new google.maps.LatLng(lat, lng);
	var myOptions = {
		zoom: 20,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP, /*表示タイプの指定*/
		draggable: false, /** ここを設定するとスマホで拡大しない **/
	};
	var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);
	var marker = new google.maps.Marker({
	position: latlng,
	map: map
	});
});

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?