ciao a tutti,
ho un problema che da qualche giorno non riesco a risolvere. con l'uscita di Firefox 4, il mio framework di Mapfish client 1.2 non mi funziona piu'. l'errore ricorrente di Javascript e': mapfish.widget is undefined e me lo da alla prima chiamata di un widget, nel mio caso il mapfish.widget.createScaleComboBox. ne seguono una serie di altri errori, ma penso che siano dovuti tutti allo stesso motivo, ovvero come Firefox 4 gestisce le inclusioni di file .js. Ho aggiornato il file OpenLayers.js con il file disponibile per la 2.11, cosi' come descritto da Lemoine lo scorso aprile: http://lists.mapfish.org/pipermail/users/2011-April/003259.html dopo aver fatto questa modifica non ho piu' errori dal lato OpenLayers, ma il mapfish.widget is undefined mi rimane, e di fatto tutta l'applicazione non funziona correttamente. ho anche letto che poteva essere un problema di Firebug 1.7, ma adesso ho messo su la 1.7.1 e poi ho anche provato disinstallando completamente Firebug. la mia configurazione e': - debian lenny - mapfish 1.2 - ext 2.2.0 - Openlayers 2.7 (con la patch di OpenLayers.js della 2.11) qualcuno si e' trovato con un errore simile ? la cosa strana che mi ha meravigliato un po' e' che in rete non ho trovato granche' al riguardo, e mi sento un po' solo. attendo lumi. saluti, francesco _______________________________________________ Iscriviti all'associazione GFOSS.it: http://www.gfoss.it/drupal/iscrizione [hidden email] http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss Questa e' una lista di discussione pubblica aperta a tutti. Non inviate messaggi commerciali. I messaggi di questa lista non rispecchiano necessariamente le posizioni dell'Associazione GFOSS.it. 502 iscritti all'11.2.2011 |
Ciao!
mal comune mezzo gaudio :-) Ho un problema simile anche io, ma non me ne sto occupando in questo periodo. Posso dirti che le versioni ultimissime di GeoExt e openLayers funzionano bene con firefox 4. E anche Mapfish ultimissima funziona: infatti sul sito di Mapfish c'è una demo funzionante [1]. Purtroppo mapfish 2 ha cambiato un po' le API, quindi migrare da 1.2 a 2 potrebbe essere faticoso. Non so dirti altro adesso, ma ci sbatterò la testa tra qualche giorno :-) [1] http://demo.mapfish.org/mapfishsample/2.0/ Ciaociao Vitomeuli --- https://sites.google.com/site/vitomeuli/ Il 24 maggio 2011 18:16, francesco marucci <[hidden email]> ha scritto: > ciao a tutti, > ho un problema che da qualche giorno non riesco a risolvere. > > con l'uscita di Firefox 4, il mio framework di Mapfish client 1.2 non mi > funziona piu'. > > l'errore ricorrente di Javascript e': > > mapfish.widget is undefined > > e me lo da alla prima chiamata di un widget, nel mio caso il > mapfish.widget.createScaleComboBox. > > ne seguono una serie di altri errori, ma penso che siano dovuti tutti allo > stesso motivo, ovvero come Firefox 4 gestisce le inclusioni di file .js. > > Ho aggiornato il file OpenLayers.js con il file disponibile per la 2.11, > cosi' come descritto da Lemoine lo scorso aprile: > http://lists.mapfish.org/pipermail/users/2011-April/003259.html > > dopo aver fatto questa modifica non ho piu' errori dal lato OpenLayers, ma > il mapfish.widget is undefined mi rimane, > e di fatto tutta l'applicazione non funziona correttamente. > > ho anche letto che poteva essere un problema di Firebug 1.7, ma adesso ho > messo su la 1.7.1 e poi ho anche provato disinstallando completamente > Firebug. > > la mia configurazione e': > - debian lenny > - mapfish 1.2 > - ext 2.2.0 > - Openlayers 2.7 (con la patch di OpenLayers.js della 2.11) > > > qualcuno si e' trovato con un errore simile ? > la cosa strana che mi ha meravigliato un po' e' che in rete non ho trovato > granche' al riguardo, e mi sento un po' solo. > > attendo lumi. > > saluti, > francesco > > _______________________________________________ > Iscriviti all'associazione GFOSS.it: http://www.gfoss.it/drupal/iscrizione > [hidden email] > http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss > Questa e' una lista di discussione pubblica aperta a tutti. > Non inviate messaggi commerciali. > I messaggi di questa lista non rispecchiano necessariamente > le posizioni dell'Associazione GFOSS.it. > 502 iscritti all'11.2.2011 > Iscriviti all'associazione GFOSS.it: http://www.gfoss.it/drupal/iscrizione [hidden email] http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss Questa e' una lista di discussione pubblica aperta a tutti. Non inviate messaggi commerciali. I messaggi di questa lista non rispecchiano necessariamente le posizioni dell'Associazione GFOSS.it. 502 iscritti all'11.2.2011 |
Ciao,
premesso che non ho molta dimestichezza con Mapfish, ma poichè proprio come dice Francesco anche secondo me che gli errori sono dovuti al modo in cui FF4 gestisce le inclusioni di file .js. posso suggerire di provare ad applicare al file MapFish.js (1.2) una patch simile con le correzioni che sono state apportate al file OpenLayers.js (aggiornanto così alla 2.11) i file MapFish.js e OpenLayers.js infatti sono piuttosto "simili"... Non me ne vogliano i puristi ... ho lasciato commentate le parti di codice precedenti e che ho sostituito, le indentazioni e il codice sono sicuramente migliorabili, ma come spunto dovrebbe essere sufficiente. /* * Copyright (C) 2009 Camptocamp * * This file is part of MapFish Client * * MapFish Client is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MapFish Client is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MapFish Client. If not, see <http://www.gnu.org/licenses/>. */ /* * This code is taken from the OpenLayers code base. * * Copyright (c) 2006-2007 MetaCarta, Inc., published under the Clear BSD * license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the * full text of the license. */ (function() { /** * Before creating the mapfish namespace, check to see if * mapfish.singleFile is true. This occurs if the * SingleFile.js script is included before this one - as is the * case with single file builds. */ var singleFile = (typeof window.mapfish == "object" && window.mapfish.singleFile); var jsFiles = window.mapfish; /** * Namespace: mapfish * The mapfish object provides a namespace for all things */ window.mapfish = { /** * Property: _scriptName * {String} Relative path of this script. */ _scriptName: "MapFish.js", /** * Function: _getScriptLocation * Return the path to this script. * * Returns: * Path to this script */ /*_getScriptLocation: function () { // Workaround for Firefox bug: // https://bugzilla.mozilla.org/show_bug.cgi?id=351282 if (window.gMfLocation) { return window.gMfLocation; } var scriptLocation = ""; var scriptName = mapfish._scriptName; var scripts = document.getElementsByTagName('script'); for (var i = 0; i < scripts.length; i++) { var src = scripts[i].getAttribute('src'); if (src) { var index = src.lastIndexOf(scriptName); // is it found, at the end of the URL? if ((index > -1) && (index + scriptName.length == src.length)) { scriptLocation = src.slice(0, -scriptName.length); break; } } } return scriptLocation; }*/ /*MODIFICA*/ _getScriptLocation: (function() { var scriptName = mapfish._scriptName; var r = new RegExp("(^|(.*?\\/))(" + scriptName + ")(\\?|$)"), s = document.getElementsByTagName('script'), src, m, l = ""; for(var i=0, len=s.length; i<len; i++) { src = s[i].getAttribute('src'); if(src) { var m = src.match(r); if(m) { l = m[1]; break; } } } return (function() { return l; }); })() }; /*FINE MODIFICA*/ /** * mapfish.singleFile is a flag indicating this file is being included * in a Single File Library build of the MapFish Library. * * When we are *not* part of a SFL build we dynamically include the * MapFish library code. * * When we *are* part of a SFL build we do not dynamically include the * MapFish library code as it will be appended at the end of this file. */ if(!singleFile) { var jsFiles = new Array( "lang/en.js", "core/Color.js", "core/GeoStat.js", "core/GeoStat/Choropleth.js", "core/GeoStat/ProportionalSymbol.js", "core/Routing.js", "core/Util.js", "core/Searcher.js", "core/Searcher/Map.js", "core/Searcher/Form.js", "core/PrintProtocol.js", "core/Offline.js", "core/Protocol.js", "core/Protocol/MapFish.js", "core/Protocol/MergeFilterDecorator.js", "core/Protocol/TriggerEventDecorator.js", "core/Strategy.js", "core/Strategy/ProtocolListener.js", "widgets/MapComponent.js", "widgets/Shortcuts.js", "widgets/ComboBoxFactory.js", "widgets/recenter/Base.js", "widgets/recenter/Coords.js", "widgets/recenter/DataField.js", "widgets/data/FeatureReader.js", "widgets/data/FeatureStore.js", "widgets/data/FeatureStoreMediator.js", "widgets/data/SearchStoreMediator.js", "widgets/data/LayerStoreMediator.js", "widgets/data/GridRowFeatureMediator.js", "widgets/geostat/Choropleth.js", "widgets/geostat/ProportionalSymbol.js", "widgets/tree/LayerTree.js", "widgets/tree/LayerTreeExtra.js", "widgets/toolbar/Toolbar.js", "widgets/toolbar/CheckItem.js", "widgets/toolbar/MenuItem.js", "widgets/editing/FeatureList.js", "widgets/editing/FeatureProperties.js", "widgets/editing/FeatureEditingPanel.js", "widgets/print/Base.js", "widgets/print/BaseWidget.js", "widgets/print/SimpleForm.js", "widgets/print/MultiPage.js", "widgets/print/PrintAction.js", "widgets/search/Form.js" ); // etc. /*var allScriptTags = ""; var host = mapfish._getScriptLocation(); for (var i = 0; i < jsfiles.length; i++) { if (/MSIE/.test(navigator.userAgent) || /Safari/.test(navigator.userAgent)) { var currentScriptTag = "<script src='" + host + jsfiles[i] + "'></script>"; allScriptTags += currentScriptTag; } else { var s = document.createElement("script"); s.src = host + jsfiles[i]; var h = document.getElementsByTagName("head").length ? document.getElementsByTagName("head")[0] : document.body; h.appendChild(s); } } if (allScriptTags) { document.write(allScriptTags); }*/ /*MODIFICA*/ // use "parser-inserted scripts" for guaranteed execution order // http://hsivonen.iki.fi/script-execution/ var scriptTags = new Array(jsFiles.length); var host = mapfish._getScriptLocation(); for (var i=0, len=jsFiles.length; i<len; i++) { scriptTags[i] = "<script src='" + host + jsFiles[i] + "'></script>"; } if (scriptTags.length > 0) { document.write(scriptTags.join("")); } /*FINE MODIFICA*/ } })(); Saluti, Marica PS. mi scuso per il testo piuttosto lungo ma non so se è possibile inviare allegati alla ML.
_______________________________________________ Iscriviti all'associazione GFOSS.it: http://www.gfoss.it/drupal/iscrizione [hidden email] http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss Questa e' una lista di discussione pubblica aperta a tutti. Non inviate messaggi commerciali. I messaggi di questa lista non rispecchiano necessariamente le posizioni dell'Associazione GFOSS.it. 502 iscritti all'11.2.2011 |
Sorry,
vista l'ora era avanzato un errore nella parte iniziale del codice. (function() { /** * Before creating the mapfish namespace, check to see if * mapfish.singleFile is true. This occurs if the * SingleFile.js script is included before this one - as is the * case with single file builds. */ var singleFile = (typeof window.mapfish == "object" && window.mapfish.singleFile); /* Relative path of this script */ var scriptName = "MapFish.js" var jsFiles = window.mapfish; /** * Namespace: mapfish * The mapfish object provides a namespace for all things */ window.mapfish = { /** * Function: _getScriptLocation * Return the path to this script. * * Returns: * Path to this script */ _getScriptLocation: (function() { var r = new RegExp("(^|(.*?\\/))(" + scriptName + ")(\\?|$)"), s = document.getElementsByTagName('script'), src, m, l = ""; ... Saluti, Marica _______________________________________________ Iscriviti all'associazione GFOSS.it: http://www.gfoss.it/drupal/iscrizione [hidden email] http://lists.gfoss.it/cgi-bin/mailman/listinfo/gfoss Questa e' una lista di discussione pubblica aperta a tutti. Non inviate messaggi commerciali. I messaggi di questa lista non rispecchiano necessariamente le posizioni dell'Associazione GFOSS.it. 502 iscritti all'11.2.2011 |
Free forum by Nabble | Edit this page |