2013-10-03 2 views
1

안녕하세요, 저는 유성을 실감하고 있습니다. 파이어 폭스에서 볼 수있는 몇 가지 문제가 있습니다. google 크롬에, everythings 잘 될거야 그리고 나는 오류없이 모든 것을 볼 수 있습니다.유성우를 사용하여 파이어 폭스를 보는 데 문제가 있습니다

내 코드는 다음과 같습니다

이 /-->server/server.js

Meteor.publish('places', function() { 
return Places.find(); 
}); 

/-->model.js 장소 = 새로운 Meteor.Collection ('placesNew');

Places.allow({ 
    insert: function(){ 
    return false; 
    }, 
    update: function(){ 
    return false; 
    }, 
    remove: function(){ 
    return false; 
    } 
}); 

Meteor.methods({ 
    createPlace: function(options){ 
    check(options, {name: NonEmptyString, latitude: NonEmptyString , longitude:NonEmptyString , color: NonEmptyString}); 
    return Places.insert({name:options.name, latitude: options.latitude, longitude: options.longitude, color: options.color}); 
    }, 

    removePlace: function(options){ 
    return Places.remove(options.id); 
    } 
}); 

var NonEmptyString = Match.Where(function (x) { 
    check(x, String); 
    return x.length !== 0; 
}); 

var map; 
renderize_map = function (places){ 
    var mapOptions = { 
     center: new google.maps.LatLng(47.36865 , 8.539183), 
     zoom: 3, 
     mapTypeId: google.maps.MapTypeId.ROADMAP 

     }; 
    map= new google.maps.Map(document.getElementById("map-canvas"), mapOptions); 
     places.forEach(function (place) { 
     var pinColor = place.color.replace("#",""); 
     var pinImage = new google.maps.MarkerImage("http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=%E2%80%A2|" + pinColor, 
     new google.maps.Size(21, 34), 
     new google.maps.Point(0,0), 
     new google.maps.Point(10, 34)); 

     var marker = new google.maps.Marker({ 
        position: new google.maps.LatLng(place.latitude, place.longitude), 
        title: place.name, 
        icon: pinImage, 
        map: map 
       }); 
    }); 
} 

/-->client/places_list.js

Meteor.subscribe('places'); 

Template.places_list.places = function() { 
    return Places.find({},{sort:{name: -1}}); 

} 

Template.places_list.events({ 
    'click #add':function() { 
     options ={}; 
     options.name = document.getElementById('name').value; 
     options.latitude = document.getElementById('latitude').value; 
     options.longitude = document.getElementById('longitude').value; 
     options.color = document.getElementById('color').value; 
     Meteor.call('createPlace',options, function(error,place){ 
     if(error){ 
      console.log("Não Foi possível inserir"); 
     } 

     }); 
     renderize_map(Places.find({},{sort:{name: 1}})); 
    }, 
    'click .plc_remove': function(obj){ 
     options={}; 
     options.id=obj.toElement.attributes['data-ref'].value; 

     Meteor.call('removePlace',options, function(error,place){ 
     if(error){ 
      console.log("Não Foi possível inserir"); 
     } 

     });  
     renderize_map(Places.find({},{sort:{name: 1}})); 
    } 

}); 

Template.maps.rendered = function() { 
    renderize_map(Places.find({},{sort:{name: 1}})); 
    } 

/-->client/places_list.css

/* CSS declarations go here */ 
#map-canvas{ 
    width: 500px; 
    height: 500px; 
} 
을 /-->services.js

/--> 클라이언트 /places_list.html

<head> 
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"> </script> 
</head> 
<body> 
    <header> 
    <h1>TableList</h1> 
    {{> places_list}} 
    {{> maps}} 
    </header> 
</body> 

<template name="places_list"> 
    <div class"place-list-form"> 
    <input type="text" placeholder="Insert a place here" value="{{name}}" id="name"/><br> 
    <input type="text" placeholder="Insert a Latitude here" value="{{latitude}}" id="latitude"/><br> 
    <input type="text" placeholder="Insert a Longitude here " value="{{longitude}}" id="longitude"/><br> 
    <input type="text" placeholder="Insert a Color here " value="{{longitude}}" id="color"/> 
    <button id="add">Add point</button> 

    </div> 
    <div class"place-list-container"> 
    <ul> 
     {{#each places}} 
     <li> {{ name}} | <a class="plc_remove" data-ref="{{_id}}" href="#">x</a> | </li> 
     {{/each}} 
    </ul> 

    </div> 

</template> 

<template name="maps"> 
    <div id="map-canvas"></div> 

</template> 

오류는 다음과 같습니다

SyntaxError: missing } after function body 
http://localhost:3000/packages/livedata.js?a3d111217f95d5af907302198a85413d1acbaf05 
Line 1766 

TypeError: Package.livedata is undefined 
http://localhost:3000/packages/mongo-livedata.js?a3509c5f9f4ed6ded19eaac97c69c2a91d81df81 
Line 28 

TypeError: Package.livedata is undefined 
http://localhost:3000/packages/global-imports.js?fbb54e05f02190869755c48bbc5e3bd9f17811b4 
Line 7 

ReferenceError: Template is not defined 
http://localhost:3000/client/template.places_list.js?ee7af8e7be9b55207b7bef609fa51cb0e5f513a9 
Line 1 

TypeError: Meteor.subscribe is not a function 
http://localhost:3000/client/places_list.js?6a2a131bfee6da3c6e08cee25711a90317cb4a4e 
Line 1 

TypeError: Meteor.Collection is not a constructor 
http://localhost:3000/model.js?9eed9b90a309156348195efef61705bab5494768 
Line 1 


ReferenceError: Spark is not defined 
http://localhost:3000/client/template.places_list.js?ee7af8e7be9b55207b7bef609fa51cb0e5f513a9 
Line 1 

사람은 helpme 수 있습니까?

감사합니다.

답변

0

모든 코드를 프로젝트에 복사하여 붙여 넣기 만하면 Firefox (OSX 버전 19.0.2)와 Chrome에서 모두 작동합니다. 또는 적어도 모든 것을로드하고 다른 브라우저에서 이름으로 표시 될 위치를 추가 할 수 있습니다.지도에 핀을 추가하지 않았습니다.

오류는 필수 기본 제공 패키지 중 일부가 올바르게로드되지 않았 음을 나타내는 매우 근본적인 오류입니다. 왜 이것이 한 브라우저에서만 문제가 될지 모르겠다. 브라우저에서 소스를 보는 경우 Chrome과 Firefox에서 동일한 패키지 목록이 표시됩니까?

제안 사항대로 프로젝트 루트 디렉토리에서 패키지 파일 (.meteor/packages)을 편집 해보십시오.

  • 표준 앱 패키지
  • autopublish
  • 불안
  • 보존-입력
  • : 분명히 응용 프로그램이 작동하고있는 다시 기본 것들을 추가 중지 될 모든 패키지를 제거하십시오

그 외에도 다른 유성 앱이 Firefox에서 제대로 실행됩니까? 부가 기능 및 설정을 확인하십시오. 그냥이 응용 프로그램과 다른 사람들이 파이어 폭스에서 일할 수 있다면 내가 생각할 수있는 모든 프로젝트는 파일을 복사하고 붙여 넣는 프로젝트를 다시 작성하는 것입니다.

+1

고마워요! 왜 그런지 모르지만 문제는 내 컴퓨터에서 실행했을 때 .. 서버에 배포했기 때문에 효과가있었습니다! – user1880372

관련 문제