Ich bin mit Anweisungen von here, wie man mit offenen Schichten zu beginnen und ich habe den Fehler: Namespace "ol" already declared - source ol-debug.js
und den Fehler
this.Va is not a function - source ol.js
offene Schichten 3 - Namespace „ol“ bereits erklärten Fehler beim Start
Ich bin ziemlich sicher, dass ich die Dateien ol.js, ol-debug.js und ol.css ordnungsgemäß in meine index.html aufgenommen habe.
Link zum Öffnen von Layern js und CSS-Dateien.
Dies ist der relevante Teil aus ol-debug.js
Datei -
/**
* Defines a namespace in Closure.
*
* A namespace may only be defined once in a codebase. It may be defined using
* goog.provide() or goog.module().
*
* The presence of one or more goog.provide() calls in a file indicates
* that the file defines the given objects/namespaces.
* Provided symbols must not be null or undefined.
*
* In addition, goog.provide() creates the object stubs for a namespace
* (for example, goog.provide("goog.foo.bar") will create the object
* goog.foo.bar if it does not already exist).
*
* Build tools also scan for provide/require/module statements
* to discern dependencies, build dependency files (see deps.js), etc.
*
* @see goog.require
* @see goog.module
* @param {string} name Namespace provided by this file in the form
* "goog.package.part".
*/
goog.provide = function(name) {
if (goog.isInModuleLoader_()) {
throw Error('goog.provide can not be used within a goog.module.');
}
if (!COMPILED) {
// Ensure that the same namespace isn't provided twice.
// A goog.module/goog.provide maps a goog.require to a specific file
if (goog.isProvided_(name)) {
throw Error('Namespace "' + name + '" already declared.');
}
}
goog.constructNamespace_(name);
};
'Ich bin mir ziemlich sicher, dass ich die ol.js, ol-debug.js und ol.css' eingeschlossen habe. Enthalten Sie entweder ol.js oder ol-debug.js, nicht beide – pavlos
Nun, das war eine Frage! Vielen Dank. – vjjj
haha. Gotcha ... froh, zu helfen, Alter – pavlos