لا يمكن أن نرى الخريطة الفعلية عند استخدام API خرائط Google

StackOverflow https://stackoverflow.com/questions/6032218

سؤال

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)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top