لا يمكن أن نرى الخريطة الفعلية عند استخدام API خرائط Google
-
14-11-2019 - |
سؤال
giveacodicetagpre.
giveacodicetagpre.
أنا أستخدم خرائط API مع markercluster لإظهار العديد من الأماكن أستطيع أن أرى شريط التكبير / التصغير، وكذلك الكتلة الناتجة عن Markercluster ولكن ليس صورة الخريطة الفعلية لماذا؟
المحلول
Try adding the following CSS:
html { height: 100%; }
body { height: 100%; }
نصائح أخرى
You could try making your map like this:
//The options for the google map
var mapOptions = {
zoom: 3,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP //Or whatever you want
};
var map = new google.maps.Map(document.getElementById('#map'), mapOptions);
This is nitpicky but it makes it alot easier to work with the map if you have to add a lot of information to it later (markers/listeners/zooms after load)
لا تنتمي إلى StackOverflow