vulcangz / svelte-baidumaps Goto Github PK
View Code? Open in Web Editor NEWSet of Baidu maps components for Svelte
Set of Baidu maps components for Svelte
Error when calling the Driving component.
Error:
message: "Uncaught (in promise): bdmap_DRIVING_POLICY_LEAST_TIME is not defined"
stack: ReferenceError: bdmap_DRIVING_POLICY_LEAST_TIME is not defined
at instance$3 (eval at handle_message (about:srcdoc:13:8), <anonymous>:1170:7)
at init (eval at handle_message (about:srcdoc:13:8), <anonymous>:323:15)
at new Driving (eval at handle_message (about:srcdoc:13:8), <anonymous>:1360:7)
at Array.create_default_slot (eval at handle_message (about:srcdoc:13:8), <anonymous>:1540:16)
at create_slot (eval at handle_message (about:srcdoc:13:8), <anonymous>:59:33)
at create_if_block (eval at handle_message (about:srcdoc:13:8), <anonymous>:615:27)
at Object.update [as p] (eval at handle_message (about:srcdoc:13:8), <anonymous>:698:21)
at update (eval at handle_message (about:srcdoc:13:8), <anonymous>:217:40)
at flush (eval at handle_message (about:srcdoc:13:8), <anonymous>:186:17)
<script>
import { Map, NavigationControl, Driving } from '@vulcangz/svelte-baidumaps';
let baseMapConfig = {
label: "this is a map base demo",
address: "china beijing",
lng: "116.404",
lat: "39.915",
zoom: 15
};
let waypoints = [
'呼和浩特',
{
lng: 112.53,
lat: 37.87
},
'陕西兵马俑'
]
</script>
<style>
.map-wrap {
height: 300px;
}
#r-result {
width: 100%;
}
</style>
<div class="map-wrap">
<Map options={ baseMapConfig }>
<NavigationControl position={"top-right"} />
<Driving
start="新街口"
end="新街口"
startCity="北京"
endCity="南京"
waypoints={waypoints}
autoViewport="true"
panel={"r-result"}>
</Driving>
</Map>
</div>
<div id="r-result"></div>
When doing local development tests, I run npm run dev
, but in the browser, the map doesn't show up
No errors in local build, but errors during actions workflow on GitHub
Run npm test
> @vulcangz/[email protected] test /home/runner/work/svelte-baidumaps/svelte-baidumaps
> start-server-and-test dev http://localhost:5000 cy:run
1: starting server using command "npm run dev"
and when url "[ 'http://localhost:5000' ]" is responding with HTTP status code 200
running tests using command "npm run cy:run"
> @vulcangz/[email protected] dev /home/runner/work/svelte-baidumaps/svelte-baidumaps
> rollup -c -w
[!] Error: Package subpath './compiler.js' is not defined by "exports" in /home/runner/work/svelte-baidumaps/svelte-baidumaps/node_modules/svelte/package.json
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './compiler.js' is not defined by "exports" in /home/runner/work/svelte-baidumaps/svelte-baidumaps/node_modules/svelte/package.json
at throwExportsNotFound (internal/modules/esm/resolve.js:285:9)
at packageExportsResolve (internal/modules/esm/resolve.js:508:3)
at resolveExports (internal/modules/cjs/loader.js:424:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:464:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:802:27)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/runner/work/svelte-baidumaps/svelte-baidumaps/node_modules/rollup-plugin-svelte/index.js:12:4)
at Module._compile (internal/modules/cjs/loader.js:999:30)
Error: server closed unexpectedly
at ChildProcess.onClose (/home/runner/work/svelte-baidumaps/svelte-baidumaps/node_modules/start-server-and-test/src/index.js:69:14)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1022:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
npm ERR! Test failed. See above for more details.
Error: Process completed with exit code 1.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.