
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
唯杰地图MCPSDK
npm install vjmcpsdk
import vjmap from vjmap
import { initializeMCP, createTool, z } from vjmcpsdk
let apiUrl = map.getService().baseUrl();
let token = map.getService().accessToken;
// 初始化MCP连接,使用新的简化API
console.log('初始化MCP连接...')
let mcpInstance = await initializeMCP({
apiBase: apiUrl,
autoConnect: true,
mapInstance: map
})
const sessionId = mcpInstance.state.sessionId
// 注册地图相关工具
await mcpInstance.registerMapTools()
// 注册自定义工具示例 (如果要自定义工具,则用下面的示例)
await registerCustomTool(mcpInstance, z)
// flashPos 函数实现
const flashPos = (bounds) => {
map.fitMapBounds(vjmap.GeoBounds.fromArray(bounds), { padding: 300 })
return new Promise((resolve) => {
const routePath = vjmap.GeoBounds.fromArray(bounds).toPointArray();
routePath.push(routePath[0])
let geoLineDatas = [];
geoLineDatas.push({
points: map.toLngLat(routePath),
properties: {
opacity: 1.0
}
})
let polylines = new vjmap.Polyline({
data: geoLineDatas,
lineColor: 'yellow',
lineWidth: 3,
lineOpacity: ['get', 'opacity'],
isHoverPointer: false,
isHoverFeatureState: false
});
polylines.addTo(map);
vjmap.createAnimation({
from: 1,
to: 10,
duration: 1000,
onUpdate: (e) => {
const data = polylines.getData();
if (data && data.features && data.features[0]) {
data.features[0].properties.opacity = parseInt(e.toString()) % 2 ? 1.0 : 0;
polylines.setData(data);
}
},
onStop: () => {
polylines.remove()
resolve({})
},
onComplete: () => {
polylines.remove()
resolve({})
}
})
})
}
// 注册自定义工具示例
async function registerCustomTool(mcpInstance, z) {
if (!mcpInstance) return
// 使用 zod 定义工具输入 schema
const inputSchema = z.object({
bounds: z.array(z.number()).length(4).describe('边界坐标数组 [minX, minY, maxX, maxY]')
})
// 创建工具定义
const tool = createTool(
'map_flash_position',
'在地图上闪烁显示指定边界区域',
inputSchema,
'custom'
)
// 创建工具处理函数
const handler = async (args) => {
try {
const validatedArgs = inputSchema.parse(args)
const { bounds } = validatedArgs
// 调用 flashPos 函数
await flashPos(bounds)
return {
content: [{
type: 'text',
text: `已在地图上闪烁显示边界区域: [${bounds.join(', ')}]`
}]
}
} catch (error) {
return {
content: [{
type: 'text',
text: `工具执行失败: ${error instanceof Error ? error.message : String(error)}`
}],
isError: true
}
}
}
// 注册工具
mcpInstance.registerTool(tool, handler, "custom")
// 重要:注册工具到服务器,这样服务端才能获取到自定义工具
try {
const serviceManager = mcpInstance.getServiceManager()
if (serviceManager) {
await serviceManager.registerToolsToServer()
console.log('自定义工具已成功注册到服务器')
}
} catch (error) {
console.error('注册自定义工具到服务器失败:', error)
}
}
唯杰地图VJMAP为用户自定义地图格式WebGIS可视化显示开发提供的一站式解决方案,支持的格式如常用的AutoCAD的DWG格式文件、GeoJSON等常用GIS文件格式,它使用WebGL矢量图块和自定义样式呈现交互式地图, 提供了全新的大数据可视化、实时流数据可视化功能,通过本产品可快速实现浏览器和移动端上美观、流畅的地图呈现与空间分析,可帮助您在网站中构建功能丰富、交互性强、可定制的地图应用。
AutoCAD格式的DWG文件,无需转换矢量地图渲染,支持栅格、图片、视频等图形渲染,支持3D模型渲染;windows,linux); 支持docker部署;支持私有化部署;支持桌面端语言开发(如C#、Java、C++语言)FAQs
vjmcpsdk
The npm package vjmcpsdk receives a total of 4 weekly downloads. As such, vjmcpsdk popularity was classified as not popular.
We found that vjmcpsdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.