目前我正在尝试更改群集图标的颜色(默认为蓝色),但我似乎无法弄明白.我已经设置了我的集群管理器等,我可以看到图标本身,但它是蓝色的.我目前正在使用默认的Google设置(请参阅下面的代码)来设置我的地图.任何帮助,将不胜感激
谢谢,
雅各
public class MainActivity extends Activity {
GoogleMap map;
ClusterManager mClusterManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MapFragment mapFragment = (MapFragment) getFragmentManager()
.findFragmentById(R.id.map);
map = mapFragment.getMap();
setUpClusterer();
}
private void setUpClusterer() {
// Declare a variable for the cluster manager.
// Position the map.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(51.503186, -0.126446), 10));
// Initialize the manager with the context and the map.
// (Activity extends context, so we can pass 'this' in the constructor.)
mClusterManager = new ClusterManager<MyItem>(this, map);
// …Run Code Online (Sandbox Code Playgroud) 我试图JSON在我的谷歌地图上为我的应用程序创建标记,但由于某种原因,它们没有显示出来.logcat没有错误或警告,但标记没有显示.
我的JSON托管在这里:https://api.myjson.com/bins/4jb09
这是我的Java:
package com.example.toshiba.jsonmap;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* @author saxman
*/
public class MainActivity extends FragmentActivity {
private static final String LOG_TAG = "ExampleApp";
private static final String SERVICE_URL = "https://api.myjson.com/bins/4jb09";
protected GoogleMap map;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
setUpMapIfNeeded();
}
@Override
protected void onResume() …Run Code Online (Sandbox Code Playgroud)