Beispiel #1
0
        public void Join(LatLng northEast, LatLng southWest)
        {
            var mapRClient = new MapRClient {
                ClientId = Context.ClientId, Color = RandomColor(), Name = "User", NorthEast = northEast, SouthWest = southWest
            };

            System.Diagnostics.Debug.WriteLine("Adding " + mapRClient);
            _maprClients.Add(mapRClient.ClientId, mapRClient);
            Clients.joinResult(_maprClients);
        }
Beispiel #2
0
        public void BoundsChanged(LatLng northEast, LatLng southWest)
        {
            string     clientId   = Context.ClientId;
            MapRClient mapRClient = _maprClients.Where(x => x.Key.Equals(clientId)).Select(x => x.Value).FirstOrDefault();

            if (mapRClient == null)
            {
                return;
            }

            mapRClient.NorthEast = northEast;
            mapRClient.SouthWest = southWest;

            _maprClients.Remove(clientId);
            _maprClients.Add(clientId, mapRClient);

            //Clients.debug(string.Format("northEast: {0}, southWest: {1}", northEast, southWest));
            Clients.updateMasterBounds(_maprClients.Select(x => x.Value).ToArray());
            //var northEast = new GeometryLatLong { Pa = "1", Lng = "2" };
            //var southWest = new GeometryLatLong { Pa = "1", Lng = "2" };
            //var testClass = new GeometryBounds { NorthEast = northEast, SouthWest = southWest };
            //string serialize = JSONHelper.Serialize(testClass);
            //var deserialize = JSONHelper.Deserialize<GeometryBounds>(serialize);
        }