سؤال

محاولة إجراء بحث حسب العنوان باستخدام مسج-ui-خريطة في المكونات.

فايرفوكس التقارير:TypeError:ح[ب] غير معرف /js/ui-map/jquery.ui.map.full.min.js خط:2

$(document).ready(function() {
        $('#map_canvas').gmap('search', { 'address': 'Stockholm' }, function(isFound,results) {
            if (isFound) {
                $('#map_canvas').gmap('getMap').panTo(results[0].geometry.location);
            }
        });
});

الرجاء المساعدة.

تحرير:ذكرت أن المطور في http://code.google.com/p/jquery-ui-map/issues/detail?id=64

هل كانت مفيدة؟

المحلول

بدلا من الخريطة الشركات('getMap') واحد يجب أن تستخدم الخريطة الشركات('get','خريطة').الى جانب ذلك يمكنك تبديل isFound و النتائج الصحيح العينة:

$(document).ready(function() {
        $('#map_canvas').gmap('search', { 'address': 'Stockholm' }, function(results,isFound) {
            if (isFound) {
                $('#map_canvas').gmap('get','map').panTo(results[0].geometry.location);
            }
        });
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top