की ऊंचाई का आकार बदलने के लिए Google मानचित्र v3 प्राप्त करें जब मैं मार्कर पर क्लिक करता हूं और InfoWindow प्रकट होता है, तो सामग्री की लंबाई लंबे समय तक InfoWindow डिफ़ॉल्ट ऊंचाई (90px) है, तो ऊंचाई समायोजित नहीं होती है।InfoWindow
- मैं केवल पाठ का उपयोग कर रहा हूं, कोई छवि नहीं।
- मैंने maxWidth को आजमाया है।
- मैंने विरासत में सीएसएस की जांच की है।
- मैंने अपनी सामग्री को div में लपेट लिया है और ऊंचाई सहित मेरे सीएसएस को लागू किया है।
- मैंने इन्फोविंडो को InfoWindow पर डोमरेड ईवेंट का उपयोग करके jQuery के साथ आकार बदलने के लिए भी कोशिश की है।
मेरे पास केवल कुछ बाल शेष हैं। यहां मेरा जेएस है:
var geocoder;
var map;
var marker;
function initialize() {
geocoder = new google.maps.Geocoder();
var latlng = new google.maps.LatLng(41.8801,-87.6272);
var myOptions = {
zoom: 13,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}
function codeAddress(infotext,address) {
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var image = '/path-to/mapMarker.png';
var infowindow = new google.maps.InfoWindow({ content: infotext, maxWidth: 200 });
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
icon: image
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
}
});
}
function checkZipcode(reqZip) {
if (/[0-9]{5}/.test(reqZip)) {
$.ajax({
url: 'data.aspx?zip=' + reqZip,
dataType: 'json',
success: function(results) {
$.each(results.products.product, function() {
var display = "<span id='bubble-marker'><strong>"+this.name+"</strong><br>"+
this.address+"<br>"+
this.city+", "+this.state+" "+this.zip+"<br>"+
this.phone+"</span>";
var address = this.address+","+
this.city+","+
this.state+","+
this.zip;
codeAddress(display,address);
});
},
error: function() { $('#information-bar').text('fail'); }
});
} else { $('#information-bar').text('Zip codes are five digit numbers.'); }
}
$('#check-zip').click(function() { $('#information-bar').text(''); checkZipcode($('#requested-zipcode').val()); });
initialize();
InfoText और पता किसी XML फ़ाइल की AJAX क्वेरी से आते हैं। डेटा मुद्दा नहीं है, क्योंकि यह हमेशा सही तरीके से आता है। कोड एड्रेस() को डेटा पुनर्प्राप्त करने और स्वरूपित करने के बाद बुलाया जाता है। फ़ाइल में
एचटीएमएल: मेरे InfoWindow सामग्री के लिए
<div id="google_map"> <div id="map_canvas" style="width:279px; height:178px"></div> </div>
सीएसएस (कोई अन्य सीएसएस मानचित्र पर लागू होता है):
#bubble-marker{ font-size:11px; line-height:15px; }
क्या आपको कभी इसका समाधान मिला? मुझे बिल्कुल वही समस्या है ... – Jeremy
मुझे यह तय नहीं हो सका और मेरे बालों और सैनिटी के लिए अंततः मैंने जो कुछ करने की कोशिश की थी, उसे फिर से बनाया। यह जानना अच्छा लगेगा कि कोई समाधान है या नहीं ... – Jeremy