internal virtual void displaySearchResults(Java.Lang.Object[] objects) { GLMapMarkerStyleCollection style = new GLMapMarkerStyleCollection(); style.AddStyle(new GLMapMarkerImage("marker", mapView.ImageManager.Open("cluster.svgpb", 0.2f, unchecked ((int)0xFFFF0000)))); style.SetDataCallback(new GLMapMarkerStyleCollectionDataCallbackAnonymousInnerClassHelper(this)); GLMapMarkerLayer layer = new GLMapMarkerLayer(objects, style); layer.SetClusteringEnabled(false); mapView.DisplayMarkerLayer(layer); //Zoom to results if (objects.Length != 0) { //Calculate bbox GLMapBBox bbox = new GLMapBBox(); foreach (object @object in objects) { if (@object is GLMapVectorObject) { bbox.AddPoint(((GLMapVectorObject)@object).Point()); } } //Zoom to bbox mapView.SetMapCenter(bbox.Center(), false); mapView.SetMapZoom(mapView.MapZoomForBBox(bbox, mapView.Width, mapView.Height), false); } }
internal virtual void addMarkersWithMapcss() { GLMapMarkerStyleCollection styleCollection = new GLMapMarkerStyleCollection(); for (int i = 0; i < unionColours.Length; i++) { float scale = (float)(0.2 + 0.1 * i); int index = styleCollection.AddStyle(new GLMapMarkerImage("marker" + scale, mapView.ImageManager.Open("cluster.svgpb", scale, unionColours[i]))); styleCollection.SetStyleName(i, "uni" + index); } GLMapVectorCascadeStyle style = GLMapVectorCascadeStyle.CreateStyle("node{icon-image:\"uni0\"; text:eval(tag(\"name\")); text-color:#2E2D2B; font-size:12; font-stroke-width:1pt; font-stroke-color:#FFFFFFEE;}" + "node[count>=2]{icon-image:\"uni1\"; text:eval(tag(\"count\"));}" + "node[count>=4]{icon-image:\"uni2\";}" + "node[count>=8]{icon-image:\"uni3\";}" + "node[count>=16]{icon-image:\"uni4\";}" + "node[count>=32]{icon-image:\"uni5\";}" + "node[count>=64]{icon-image:\"uni6\";}" + "node[count>=128]{icon-image:\"uni7\";}"); new AsyncTaskAnonymousInnerClassHelper(this, styleCollection, style).Execute(); }
internal virtual void addMarkers() { GLMapMarkerStyleCollection style = new GLMapMarkerStyleCollection(); int[] unionCounts = new int[] { 1, 2, 4, 8, 16, 32, 64, 128 }; for (int i = 0; i < unionCounts.Length; i++) { float scale = (float)(0.2 + 0.1 * i); style.AddStyle(new GLMapMarkerImage("marker" + scale, mapView.ImageManager.Open("cluster.svgpb", scale, unionColours[i]))); } GLMapVectorStyle textStyle = GLMapVectorStyle.CreateStyle("{text-color:black;font-size:12;font-stroke-width:1pt;font-stroke-color:#FFFFFFEE;}"); style.SetDataCallback(new GLMapMarkerStyleCollectionDataCallbackAnonymousInnerClassHelper2(this, unionCounts, textStyle)); new AsyncTaskAnonymousInnerClassHelper2(this, style).Execute(); }