我现在用的是Leaflet.Awesome标志物与插件LeafletJS.
我已经正确实现了它,但是现在我希望能够使用0到9之间的数字来表示标记.
这是一个JS Fiddle实现,用于展示插件的行为方式.
http://jsfiddle.net/fulvio/VPzu4/200/
该插件允许使用字体 - 真棒图标和字形图标(当然,不提供任何0 - 9数字作为图标.唉!)
文档提到了使用的能力extraClasses,我想知道是否有人能指出我正确的方向,如何利用这个来显示数字而不是图标或是否只是另一种方法来实现这一点.
在此先感谢您的帮助.
更新:
感谢@Can的评论.
awesome-markers的作者得到了另一棵树,在那里他准确地添加了你正在寻找的数字/字母的真棒标记,一定要抓住未经证实的JS.
我们有以下TestComponent.tsTypeScript类:
01: import TestVectorLayer from './TestVectorLayer'
02:
03: export class TestComponent implements OnInit {
04: private foo: any;
05:
06: constructor() { }
07:
08: const layer = new TestVectorLayer("foo");
09: }
Run Code Online (Sandbox Code Playgroud)
并具有以下TestVectorLayer.ts功能:
请记住,OpenLayer 3正在使用Google Closure库,这就是为什么TestVectorLayer它不是TypeScript类.
01: declare let ol: any;
02:
03: const TestVectorLayer = function (layerName: string) {
04: ...
05: console.log(layerName);
06:
07: ol.layer.Image.call(this, opts);
08: }
09:
10: ol.inherits(TestVectorLayer as any, ol.layer.Image as any);
11:
12: export default TestVectorLayer;
Run Code Online (Sandbox Code Playgroud)
我们收到以下错误: …
我正在播放几种声音:AudioServices
AudioServicesPlaySystemSound(aSystemSoundID);
当我在连接到机器的iPhone 3G上测试项目时,我收到以下消息:
> 2010-09-16 17:29:29.672
> myProject[6528:6def] [17:29:29.672
> <0x85d400>] PlaySound posting message
> to kill mediaserverd (5958) [Switching
> to thread 13059]
Run Code Online (Sandbox Code Playgroud)
和/或:
> 2010-09-16 17:30:28.316
> myProject[6528:6def] [17:30:28.316
> <0x85d400>] AudioQueueNew posting
> message to kill mediaserverd (0)
> Error: AudioQueueNewInput failed
> (0x10004003)
Run Code Online (Sandbox Code Playgroud)
知道为什么吗?
谢谢.
顺便说一句,在模拟器上一切正常.
我正在写一个webpack-react-typescript工具包,我发现源映射不能直接指向源代码,它直接指向source-map,这个文件有一些webpack注入代码.但是另一台计算机同时具有域webpack-internal://src/App.tsx file和webpack://域,以及webpack-internal域中可以指向当前源代码的源映射.所以我想知道的是:
1.什么是之间的不同webpack://和webpack
2.为什么有些电脑必须webpack-internal和somecomputer都没有了吗?
鉴于以下情况struct:
struct PeopleList : View {
@State var angle: Double = 0.0
@State var isAnimating = true
var foreverAnimation: Animation {
Animation.linear(duration: 2.0)
.repeatForever()
}
var body: some View {
Button(action: {}, label: {
Image(systemName: "arrow.2.circlepath")
.rotationEffect(Angle(degrees: self.isAnimating ? self.angle : 0.0))
.onAppear {
withAnimation(self.foreverAnimation) {
self.angle += 10.0
}
}
})
}
}
Run Code Online (Sandbox Code Playgroud)
我希望它Image会顺时针旋转并重复直到self.isAnimating是,false尽管它只动画一次。
我正在使用nasm来编译以下程序集.但是,代码在Windows下的控制台中崩溃.
C:\> nasm -f win32 test.asm -o test.o
C:\> ld test.o -o test.exe
section .data
msg db 'Hello world!', 0AH
len equ $-msg
section .text
global _WinMain@16
_WinMain@16:
mov edx, len
mov ecx, msg
mov ebx, 1
mov eax, 4
int 80h
mov ebx, 0
mov eax, 1
int 80h
Run Code Online (Sandbox Code Playgroud)
根据这篇文章.该main功能在Windows下不可用,必须替换为WinMain.
因此,如果您的入口点是_start或main,则应将其更改为_WinMain@16并将ret过程结束时更改为ret 16:
我的工作范例:
section .text
global _WinMain@16
_WinMain@16:
mov eax, 0 …Run Code Online (Sandbox Code Playgroud) 我有以下代码:
func setupShortcutItems(launchOptions: [NSObject: AnyObject]?) -> Bool {
var shouldPerformAdditionalDelegateHandling: Bool = false
if (UIApplicationShortcutItem.respondsToSelector("new")) {
self.configDynamicShortcutItems()
// If a shortcut was launched, display its information and take the appropriate action
if let shortcutItem: UIApplicationShortcutItem = launchOptions?[UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem {
// When the app launched at the first time, this block can not called.
self.handleShortCutItem(shortcutItem)
// This will block "performActionForShortcutItem:completionHandler" from being called.
shouldPerformAdditionalDelegateHandling = false
} else {
// normal app launch process without quick action
self.launchWithoutQuickAction()
}
} …Run Code Online (Sandbox Code Playgroud) 如果我使用以下代码LayerPoint从指定的Lat/Lng获取:
var latLng = new L.latLng(-37.81303878836989, 144.97421264648438);
var point = map.latLngToLayerPoint(latLng);
Run Code Online (Sandbox Code Playgroud)
输出如下:
o.Point
x: 86042
y: 77065
Run Code Online (Sandbox Code Playgroud)
然后,当我尝试使用以下URL访问图层磁贴时:
http://a.tile.osm.org/10/86042/77065.png
我得到404因为它是无效的X,Y.
现在,如果我使用以下代码:
map.on("click", function (e) {
console.log(e);
});
Run Code Online (Sandbox Code Playgroud)
我可以LayerPoint在纬度和经度旁边检索控制台.
latlng: o.LatLng
lat: -37.81303878836989
lng: 144.97421264648438
layerPoint: o.Point
x: 950
y: 303
Run Code Online (Sandbox Code Playgroud)
然后访问以下URL返回此图层磁贴:
http://a.tile.osm.org/10/950/303.png

问题是,它甚至看起来不是那个纬度经度的正确磁贴,也不是我的原始代码将lat lng转换为LayerPoint实际上首先返回一个有效的X,Y.
我很困惑为什么我得到这些结果.任何帮助将不胜感激.也许我做错了什么.
我不确定是否有另一种基于纬度和经度列表检索切片图层的方法?
我之后的原因是因为我希望能够为离线应用程序使用缓存的磁贴数据,而我所拥有的唯一数据是通过为客户端应用程序生成的GeoJSON有效负载的几何/坐标.
更新:
结束这个功能(感谢@scai).
根据这个链接.
var getSlippyTileLayerPoints = function (lat_deg, lng_deg, zoom) {
var x = (Math.floor((lng_deg + 180) / 360 * Math.pow(2, zoom)));
var …Run Code Online (Sandbox Code Playgroud) AppDelegate当我的应用程序进入后台时,我有以下代码:
var backgroundUpdateTask: UIBackgroundTaskIdentifier!
func beginBackgroundUpdateTask() {
self.backgroundUpdateTask = UIApplication.sharedApplication().beginBackgroundTaskWithExpirationHandler({
self.endBackgroundUpdateTask()
})
}
func endBackgroundUpdateTask() {
UIApplication.sharedApplication().endBackgroundTask(self.backgroundUpdateTask)
self.backgroundUpdateTask = UIBackgroundTaskInvalid
}
func doBackgroundTask() {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), {
self.beginBackgroundUpdateTask()
// Do something with the result.
var timer = NSTimer.scheduledTimerWithTimeInterval(5, target: self, selector: "displayAlert", userInfo: nil, repeats: false)
NSRunLoop.currentRunLoop().addTimer(timer, forMode: NSDefaultRunLoopMode)
NSRunLoop.currentRunLoop().run()
// End the background task.
self.endBackgroundUpdateTask()
})
}
func displayAlert() {
let note = UILocalNotification()
note.alertBody = "As a test I'm hoping this will run in the background every …Run Code Online (Sandbox Code Playgroud) 我有一种情况,我一直在使用Resolve在导航到组件之前通过HTTP调用从远程源预加载一些数据.现在我需要实现一些保护逻辑,这需要根据某些条件预先加载数据以验证当前用户的某些字段.
我想避免向CanActivate守卫中的后端发出完全相同的请求,然后立即向后卫发出相同的请求Resolve.
有没有什么方法可以从CanActivate路径配置或路由配置中访问路由数据来临时覆盖解析器,只是设置数据对象的值,因为我已经得到了我要请求的内容?
我试着逃避一些简单的事情
route.data['myData'] = value;
Run Code Online (Sandbox Code Playgroud)
但这是一个错误,因为"对象不可扩展".
我也试过类似的东西:
this.router.routerState.root.data['myData'] = value;
Run Code Online (Sandbox Code Playgroud)
哪个没有产生任何错误,但是数据没有存活到方法的route.data元素中Resolve.resolve().
我想避免像定制或hacky这样的东西,就像临时将对象存储在服务上一样,就像某种缓存一样.是否有任何标准机制在内部路由器元素之间传输数据以支持高级预取和数据所有权检查等内容?
编辑
如果将路由器注入到Resolve类的构造函数中,并且以相同的方式访问它,则routerState可以正常工作.但这需要在之后清除,否则它会在导航呼叫之间保持不变.
javascript ×3
swift ×3
dictionary ×2
iphone ×2
leaflet ×2
objective-c ×2
typescript ×2
angular ×1
assembly ×1
core-audio ×1
font-awesome ×1
geojson ×1
ios ×1
markers ×1
mingw ×1
nasm ×1
reactjs ×1
swiftui ×1
webpack ×1
windows ×1
xcode ×1