小编Sey*_*baf的帖子

myLocationOverlay更改标记

如何在谷歌地图中更改MyLocationOverlay的默认蓝色动画标记?

java maps android google-maps marker

4
推荐指数
2
解决办法
9207
查看次数

找出OSMdroid中的当前位置

我想找到我当前位置的地图并在我移动时通过在OSMdroid中显示一个图标来更新它.我在给出具体位置纬度和经度以及绘图图标时发现没有问题但是当我给出当前位置纬度和经度时有两个错误.

public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    mResourceProxy = new DefaultResourceProxyImpl(getApplicationContext());
    setContentView(R.layout.main);        
    mMapView = (MapView) this.findViewById(R.id.mapview);
    mMapView.setTileSource(TileSourceFactory.MAPNIK);
    mMapView.setBuiltInZoomControls(true);
    mMapView.setMultiTouchControls(true);        
    mapController = this.mMapView.getController();
    mapController.setZoom(15);

    Criteria criteria = new Criteria();
    criteria.setAccuracy(Criteria.ACCURACY_FINE);
    criteria.setAltitudeRequired(false);
    criteria.setBearingRequired(false);
    criteria.setCostAllowed(true);
    criteria.setPowerRequirement(Criteria.POWER_LOW);
    String provider = mLocMgr.getBestProvider(criteria, true);
    Location location = mLocMgr.getLastKnownLocation(provider);
    GeoPoint mypoint = new GeoPoint(location.getLatitude(), location.getLongitude()); // centre map here
    GeoPoint mypointicon = new GeoPoint(location.getLatitude()+1000, location.getLongitude()+1000); // icon goes here
    mapController.setCenter(mypoint);            
    mLocMgr = (LocationManager) getSystemService(LOCATION_SERVICE);
    mLocMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000, 100,
            this);        
    ArrayList<OverlayItem> items=new ArrayList<OverlayItem>();
    items.add(new OverlayItem("Here", "Sample Description", mypointicon));
    this.mMyLocationOverlay …
Run Code Online (Sandbox Code Playgroud)

android osmdroid

4
推荐指数
1
解决办法
1万
查看次数

Osmdroid地图旋转

我正在做osmdroid地图项目.我正在使用自定义瓷砖进行地图.谁能告诉我如何旋转自定义瓷砖地图?

android tiles map rotation osmdroid

4
推荐指数
1
解决办法
3523
查看次数

在 Android 版 OSMDroid 中旋转标记?

好吧,这个问题已经困扰我好几个小时了,我有以下相对简单的代码,可以在 osmdroid 地图上放置一个标记

final ArrayList<OverlayItem> items = new ArrayList<OverlayItem>();
OverlayItem marker = new OverlayItem("markerTitle", "markerDescription", new GeoPoint(52.033954,1.210179));
marker.setMarkerHotspot(OverlayItem.HotspotPlace.TOP_CENTER);
items.add(marker);

Drawable newMarker = this.getResources().getDrawable(R.drawable.maincar);
DefaultResourceProxyImpl resProxyImp = new DefaultResourceProxyImpl(getApplicationContext());
ItemizedIconOverlay markersOverlay = new ItemizedIconOverlay<OverlayItem>(items, newMarker, null, resProxyImp);
mapView.getOverlays().add(markersOverlay);
Run Code Online (Sandbox Code Playgroud)

然而,标记始终面向屏幕顶部(0 度旋转)。我怎样才能轻松地将每个标记旋转到指定的角度(360 度是一个完整的圆)?

java maps android openstreetmap osmdroid

4
推荐指数
1
解决办法
3371
查看次数

WPF按钮单击和命令不能一起工作MVVM

我正在使用mvvm开发一些wpf应用程序.我正在尝试使用按钮单击事件和命令,但命令永远不会执行.此外,当我只使用没有点击事件的命令时,它完美无缺.这是代码:

<ControlTemplate x:Key="reminderDataTemplate">          
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="25" />
            <RowDefinition Height="150" />
            <RowDefinition Height="20" />
        </Grid.RowDefinitions>
        <Label Grid.Row="0" Content="New reminder:" HorizontalAlignment="Left" />
        <TextBox Text="{Binding Path=ReminderText, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1" Height="150" Width="200" HorizontalAlignment="Left"/>
        <Button Name="btnSaveReminder" Grid.Row="2" Content="Save" Width="auto" Height="20" HorizontalAlignment="Left" Click="btnSaveReminder_Click"  Command="{Binding Path= btnSaveReminder}"  />
    </Grid>
</ControlTemplate>
Run Code Online (Sandbox Code Playgroud)

为什么会这样?

只是提到我必须一起使用click和command因为我的视图和viewmodel在不同的项目中.

更新: 另外要说的是,当我在控制模板外的按钮中一起使用click和command时,一切都很完美.

c# wpf mvvm

4
推荐指数
1
解决办法
8916
查看次数

如何将VBscript转换为Python代码?

我的老板已经要求我转换一个vb脚本,每周五手动运行到python中,除非他想要自动化.我是编程新手,想要一些帮助来决定如何解决这个问题.这将是我的第一个真正的编程项目,fortunatley没有实时限制.

上下文:我们有一个ESRI Flexviewer,用于在我们的组织中显示地图.有问题的脚本采用折线,计算线的角度,然后计算流向.它通过在折线要素类中使用to和from字段并在每个管道的中点放置方向箭头来完成此操作.

我已经粘贴了下面的脚本...它有点长,但任何帮助将不胜感激!

所以我要求的是关于如何攻击它的建议.刚开始.我列出了VB脚本使用的主要进程吗?我是否绘制了流程图并编写了python的psydo代码?我应该识别主要过程,例如循环?并使用它作为框架开始?

Imports System.Runtime.InteropServices
Imports System.Drawing
Imports ESRI.ArcGIS.ADF.BaseClasses
Imports ESRI.ArcGIS.ADF.CATIDs
Imports ESRI.ArcGIS.Display
Imports ESRI.ArcGIS.Framework
Imports ESRI.ArcGIS.Catalog
Imports ESRI.ArcGIS.CatalogUI
Imports ESRI.ArcGIS.Carto
Imports ESRI.ArcGIS.Geometry
Imports ESRI.ArcGIS.Geodatabase
Imports ESRI.ArcGIS.esriSystem
Imports ESRI.ArcGIS.SystemUI
Imports System.Windows

<ComClass(CmdFlowCreation.ClassId, CmdFlowCreation.InterfaceId, CmdFlowCreation.EventsId), _
 ProgId("FlowArrows.CmdFlowCreation")> _
Public NotInheritable Class CmdFlowCreation
    Inherits BaseCommand

#Region "COM GUIDs"
    ' These  GUIDs provide the COM identity for this class 
    ' and its COM interfaces. If you change them, existing 
    ' clients will no longer be able to access the class.
    Public …
Run Code Online (Sandbox Code Playgroud)

python vb.net vbscript esri

4
推荐指数
1
解决办法
1823
查看次数

无法平移或移动osmdroid地图

我在示例应用程序中使用osmdroid映射.看到地图,缩放工作,一切都很好,除了我无法平移/移动地图.

我的主要xml代码是:

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <org.osmdroid.views.MapView
        android:id="@+id/mapview"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:clickable="true"
        android:focusable="true"
        android:focusableInTouchMode="true">

    </org.osmdroid.views.MapView>

 </RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

我的java代码是:

 public class MapTest extends Activity {

private MapView mapView;
private MapController mapController;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map_test);
    mapView = (MapView) findViewById(R.id.mapview);
    mapView.setBuiltInZoomControls(false);
    mapView.setMultiTouchControls(true);
    mapController = this.mapView.getController();
    mapController.setZoom(10);
    GeoPoint mapCenter = new GeoPoint(17.4467, 78.4667);
    mapController.setCenter(mapCenter);
}

}
Run Code Online (Sandbox Code Playgroud)

关于如何启用运动的任何想法?

android osmdroid

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

关注Maps API教程时出现"错误导致类片段错误"错误

我一直在关注Xamarin Maps API教程,并且一直遇到问题.其中最一致的是'Android.Views.InflateException'.我已经完成了绝对的信件,但却无法找到问题所在.我还回顾了关于这个问题的其他类似问题,但没有任何帮助 - 该项目根本不会构建.

MainActivity.cs:

using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace NewMapApp
{
    [Activity (Label = "NewMapApp", MainLauncher = true)]
    public class MainActivity : Activity
    {
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);

                    // this line causes the error
            SetContentView (Resource.Layout.Main);
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

Main.axml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <fragment
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.MapFragment" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪:

Android.Views.InflateException: Binary XML …
Run Code Online (Sandbox Code Playgroud)

android google-maps xamarin

0
推荐指数
1
解决办法
4789
查看次数

获取LinearLayout由Id使用Xamarin返回null

我为什么要这样mainLayout==null

protected override void OnCreate (Bundle bundle)
{
    base.OnCreate (bundle);
    SetContentView (Resource.Layout.Main);
    LinearLayout mainLayout = FindViewById<LinearLayout> (Resource.Layout.Main);//return null
    mainLayout.Touch+=(s,e)=>
    {
         //something
    }
}
Run Code Online (Sandbox Code Playgroud)

如何获取MainLayout或如何添加事件处理程序Touch?

Resource.designer.cs:

public partial class Layout
{
    public const int Main = 2130903041;
    //other
}
Run Code Online (Sandbox Code Playgroud)

android nullreferenceexception xamarin.android android-linearlayout xamarin

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