小编Mar*_*cak的帖子

在传单中着色连续数据,R 不起作用

这是我的数据:

t <- data.frame(Name=c('A','B','C','D','E','F','G','H','I','J'),
                Longitude=c(151.2008,151.2458,150.8217,151.1215,150.8906,151.0660,150.8889,150.9188,150.4364,150.9982),
                Latitude=c(-33.90772,-33.89250,-34.05951,-33.97856,-34.40470,-33.90010,-33.92832,-33.90761,-34.44651,-33.79232),
                Diff=c(0.03,0.10,0.12,0.04,-0.12,0.34,-0.14,-0.01,0.21,-0.02),
                Diff1=c(30,100,120,40,-120,340,-140,-10,210,-20))
Run Code Online (Sandbox Code Playgroud)

我想使用传单和 R 在地图上绘制这些点,并使用 Diff / Diff1 的值进行连续颜色。这是我的代码:

library(leaflet)
pal <- colorNumeric(
    palette = colorRampPalette(c('red','green')),
    domain = t$Diff1)
leaflet(data=t) %>%
    addTiles() %>%
    addCircles(lng=~Longitude,lat=~Latitude,radius=10,popup=~Name,color=~pal(Diff1))
Run Code Online (Sandbox Code Playgroud)

我在这里不需要很多不同的颜色。我只是希望颜色可以随着 Diff1 的增加而从红色变为绿色。但我的地图上只有红点:

在此处输入图片说明

另一个问题是无论我如何改变半径的值,数据点的大小根本没有改变。我不知道我哪里错了。

所以,我的问题是:

如何使用连续色?如何改变点的大小?

r colors leaflet

3
推荐指数
1
解决办法
2333
查看次数

在请求中将发布参数映射到DTO

在我的Spring启动应用程序中,我将POST使用以下(例如)params 发送数据:

data: {
        'title': 'title',
        'tags': [ 'one', 'two' ],
        'latitude': 20,
        'longitude': 20,
        'files': [ ], // this comes from a file input and shall be handled as multipart file
    }
Run Code Online (Sandbox Code Playgroud)

在我的@Controller身上:

@RequestMapping(
        value = "/new/upload", method = RequestMethod.POST,
        produces = BaseController.MIME_JSON, consumes = BaseController.MIME_JSON
)
public @ResponseBody HttpResponse performSpotUpload(final SpotDTO spot) {
// ...
}
Run Code Online (Sandbox Code Playgroud)

哪里SpotDTO是非POJO全班getterssetters.

public class SpotDTO implements DataTransferObject {

    @JsonProperty("title") …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc java-8 spring-boot

3
推荐指数
1
解决办法
2211
查看次数

iOS设置阴影半径不起作用

UILabel设置阴影半径不起作用.

[self.testLabel.layer setShadowColor:[[UIColor purpleColor] CGColor]];
[self.testLabel.layer setShadowOffset:CGSizeMake(3, 3)];
[self.testLabel.layer setShadowRadius:5.0f];
[self.testLabel.layer setMasksToBounds:YES];
Run Code Online (Sandbox Code Playgroud)

我的代码(Google云端硬盘) https://drive.google.com/file/d/0B5UPvOBH3cqvOFlvZHhKdlNhb0E/view?usp=sharing

如果这是一个重复的问题,我很抱歉.非常感谢.

shadow uilabel ios

2
推荐指数
1
解决办法
2601
查看次数

问:更改 Android Studio 中的通知图标

我配置了应用程序图标(图 1),但通知图标(通过 Firebase 发送的通知)显示一个灰色矩形(图 2)。通过 Android Studio 2.3 或脚本更改通知图标图像(图 2)的过程是什么?

显现

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.studioshow.studioshow">
<uses-permission android:name="android.permission.INTERNET" />
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity android:name=".MainActivity">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />


        </intent-filter>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

图 1 图 2

android android-notifications firebase firebase-cloud-messaging

2
推荐指数
1
解决办法
3668
查看次数

用c->无限循环中的中点算法填充绘制的圆?

我试图用中点算法绘制一个实心圆.我已设法绘制一个未填充的圆,y0 = 320; x0 = 240; radius = 180-使用以下代码(参考:https://en.wikipedia.org/wiki/Midpoint_circle_algorithm):

int x0, int y0, int radius;

x0 = 320;     //assign values
y0 = 240;
radius = 180;

int x = radius-1;
int y = 0;
int dx = 1;
int dy = 1;
int err = dx - (radius << 1);

while (x >= y)
{
    putpixel(x0 + x, y0 + y);
    putpixel(x0 + y, y0 + x);
    putpixel(x0 - y, y0 + x);
    putpixel(x0 - x, …
Run Code Online (Sandbox Code Playgroud)

c algorithm geometry infinite-loop

2
推荐指数
1
解决办法
523
查看次数