Esempio n. 1
0
 protected virtual void OnPushpinRemoved(VEPushpin pushpin)
 {
     if (PushpinRemoved != null)
     {
         PushpinRemoved(pushpin);
     }
 }
        public static string CreateMapUrl(string baseUrl, float latitude, float longitude, string reserved, string style, int level, VEPushpin[] pushpins, VEBirdseyeScene birdseyeScene)
        {
            //string queryString = String.Format(MAP_QUERY_FORMAT, latitude, longitude, level, style);

            StringBuilder sb     = new StringBuilder();
            String        coords = latitude.ToString(CultureInfo.InvariantCulture) + "~" + longitude.ToString(CultureInfo.InvariantCulture);

            if (reserved != null && reserved != String.Empty)
            {
                coords = reserved;
            }

            sb.AppendFormat(MAP_QUERY_FORMAT, coords, level, style);
            if (birdseyeScene != null)
            {
                sb.Append("&scene=");
                sb.Append(birdseyeScene.SceneId);
            }

            if (pushpins != null && pushpins.Length > 0)
            {
                sb.Append("&sp=");
                for (int i = 0; i < pushpins.Length; i++)
                {
                    VEPushpin pin = pushpins[i];
                    if (i > 0)
                    {
                        sb.Append("~");
                    }
                    sb.AppendFormat(CultureInfo.InvariantCulture, "aN.{0}_{1}_{2}_{3}", pin.VELatLong.Latitude, pin.VELatLong.Longitude, EncodeQueryValue(pin.Title), EncodeQueryValue(pin.Details));
                    if (pin.MoreInfoUrl != String.Empty || pin.PhotoUrl != String.Empty)
                    {
                        sb.AppendFormat(CultureInfo.InvariantCulture, "_{0}", EncodeQueryValue(pin.MoreInfoUrl));
                        if (pin.PhotoUrl != String.Empty)
                        {
                            sb.AppendFormat(CultureInfo.InvariantCulture, "_{0}", EncodeQueryValue(pin.PhotoUrl));
                        }
                    }
                }
            }

            // ja-jp is the only non en supported market for maps, so special case it
            string cultureName = CultureInfo.CurrentUICulture.Name.ToUpperInvariant();

            if (IsSupportedLanguage(cultureName))
            {
                sb.Append("&mkt=" + cultureName);
            }
            else
            {
                sb.Append("&mkt=en-us");
            }

            string queryString = sb.ToString();

            return(baseUrl + "?" + queryString);
        }
Esempio n. 3
0
            private void _mapPushpinEditedHandler(MapPushpinInfo pushpinInfo)
            {
                VEPushpin oldPushpin = _mapControl.GetPushpin(_pushpinId);

                if (oldPushpin != null)
                {
                    _mapControl.UpdatePushpin(
                        new VEPushpin(_pushpinId, oldPushpin.VELatLong, oldPushpin.ImageFile, pushpinInfo.Title, pushpinInfo.Notes,
                                      pushpinInfo.MoreInfoUrl, pushpinInfo.PhotoUrl));
                }
            }
Esempio n. 4
0
        public void DeletePushpin(string pushpinId)
        {
            VEPushpin pushpin = GetPushpin(pushpinId);

            if (pushpin != null)
            {
                _pushpinTable.Remove(pushpinId);
                _pushpinList.Remove(pushpin);
                EnqueueEvent(new PushpinEvent(pushpin, PushpinEvent.PushPinAction.Delete));
                OnPushpinRemoved(pushpin);
            }
        }
        private void AddPushpinSettings(VEPushpin pushpin)
        {
            IProperties pushpinSettings = _settings.GetSubProperties(PUSHPINS).GetSubProperties(pushpin.PinId);

            pushpinSettings.SetFloat(PUSHPIN_LATITUDE, pushpin.VELatLong.Latitude);
            pushpinSettings.SetFloat(PUSHPIN_LONGITUDE, pushpin.VELatLong.Longitude);
            pushpinSettings.SetString(PUSHPIN_TITLE, pushpin.Title);
            pushpinSettings.SetString(PUSHPIN_IMAGE_URL, pushpin.ImageFile);
            pushpinSettings.SetString(PUSHPIN_DETAILS, pushpin.Details);
            pushpinSettings.SetString(PUSHPIN_MORE_INFO_URL, pushpin.MoreInfoUrl);
            pushpinSettings.SetString(PUSHPIN_PHOTO_URL, pushpin.PhotoUrl);
        }
Esempio n. 6
0
 public void AddPushpin(VEPushpin pushpin)
 {
     if (_pushpinTable.ContainsKey(pushpin.PinId))
     {
         UpdatePushpin(pushpin);
     }
     else
     {
         _pushpinTable[pushpin.PinId] = pushpin;
         _pushpinList.Add(pushpin);
         EnqueueEvent(new PushpinEvent(pushpin, PushpinEvent.PushPinAction.Add));
     }
 }
        public static string CreateMapUrl(string baseUrl, float latitude, float longitude, string reserved, string style, int level, VEPushpin[] pushpins, VEBirdseyeScene birdseyeScene)
        {
            //string queryString = String.Format(MAP_QUERY_FORMAT, latitude, longitude, level, style);

            StringBuilder sb = new StringBuilder();
            String coords = latitude.ToString(CultureInfo.InvariantCulture) + "~" + longitude.ToString(CultureInfo.InvariantCulture);
            if (reserved != null && reserved != String.Empty)
                coords = reserved;

            sb.AppendFormat(MAP_QUERY_FORMAT, coords, level, style);
            if (birdseyeScene != null)
            {
                sb.Append("&scene=");
                sb.Append(birdseyeScene.SceneId);
            }

            if (pushpins != null && pushpins.Length > 0)
            {
                sb.Append("&sp=");
                for (int i = 0; i < pushpins.Length; i++)
                {
                    VEPushpin pin = pushpins[i];
                    if (i > 0)
                    {
                        sb.Append("~");
                    }
                    sb.AppendFormat(CultureInfo.InvariantCulture, "aN.{0}_{1}_{2}_{3}", pin.VELatLong.Latitude, pin.VELatLong.Longitude, EncodeQueryValue(pin.Title), EncodeQueryValue(pin.Details));
                    if (pin.MoreInfoUrl != String.Empty || pin.PhotoUrl != String.Empty)
                    {
                        sb.AppendFormat(CultureInfo.InvariantCulture, "_{0}", EncodeQueryValue(pin.MoreInfoUrl));
                        if (pin.PhotoUrl != String.Empty)
                            sb.AppendFormat(CultureInfo.InvariantCulture, "_{0}", EncodeQueryValue(pin.PhotoUrl));
                    }
                }
            }

            // ja-jp is the only non en supported market for maps, so special case it
            string cultureName = CultureInfo.CurrentUICulture.Name.ToUpperInvariant();
            if (IsSupportedLanguage(cultureName))
                sb.Append("&mkt=" + cultureName);
            else
                sb.Append("&mkt=en-us");

            string queryString = sb.ToString();

            return baseUrl + "?" + queryString;
        }
Esempio n. 8
0
            private void EditPushpin()
            {
                VEPushpin pushpin = _mapControl.GetPushpin(_pushpinId);

                if (pushpin != null)
                {
                    MapPushpinInfo pushpinInfo = new MapPushpinInfo(pushpin.Title);
                    pushpinInfo.Notes       = pushpin.Details;
                    pushpinInfo.MoreInfoUrl = pushpin.MoreInfoUrl;
                    pushpinInfo.PhotoUrl    = pushpin.PhotoUrl;
                    MapPushpinForm pushpinForm =
                        new MapPushpinForm(_mapForm, _mapControl.PointToScreen(new Point(_event.X, _event.Y)),
                                           new MapPushpinEditedHandler(_mapPushpinEditedHandler), pushpinInfo);
                    pushpinForm.Show();
                    pushpinForm.FloatAboveOwner(_mapForm);
                }
            }
Esempio n. 9
0
 public void UpdateSettings(float latitude, float longitude, string reserved, int zoomLevel, string style, VEPushpin[] pushpins, VEBirdseyeScene birdseyeScene)
 {
     Latitude = latitude;
     Longitude = longitude;
     Reserved = reserved;
     ZoomLevel = zoomLevel;
     MapStyle = style;
     Pushpins = pushpins;
     if (birdseyeScene != null)
     {
         BirdseyeSceneId = birdseyeScene.SceneId;
         BirdseyeOrientation = birdseyeScene.Orientation.ToString();
     }
     else
     {
         BirdseyeSceneId = null;
         BirdseyeOrientation = null;
     }
     MapImageInvalidated = true;
 }
Esempio n. 10
0
 public void UpdatePushpin(VEPushpin pushpin)
 {
     DeletePushpin(pushpin.PinId);
     AddPushpin(pushpin);
 }
Esempio n. 11
0
 private void _activeObject_PushpinRemoved(VEPushpin pushpin)
 {
     OnPushpinRemoved(pushpin);
 }
Esempio n. 12
0
 public void UpdatePushpin(VEPushpin pushpin)
 {
     _activeObject.UpdatePushpin(pushpin);
 }
Esempio n. 13
0
 public void AddPushpin(VEPushpin pushpin)
 {
     _activeObject.AddPushpin(pushpin);
 }
Esempio n. 14
0
 protected virtual void OnPushpinRemoved(VEPushpin pushpin)
 {
     if (PushpinRemoved != null)
         PushpinRemoved(pushpin);
 }
 public void UpdatePushpin(VEPushpin pushpin)
 {
     DeletePushpin(pushpin.PinId);
     AddPushpin(pushpin);
 }
 internal PushpinEvent(VEPushpin pushpin, PushPinAction action)
 {
     _pushpin = pushpin;
     _action = action;
 }
Esempio n. 17
0
 public void AddPushpin(VEPushpin pushpin)
 {
     _activeObject.AddPushpin(pushpin);
 }
Esempio n. 18
0
 private void _activeObject_PushpinRemoved(VEPushpin pushpin)
 {
     OnPushpinRemoved(pushpin);
 }
Esempio n. 19
0
 public void UpdatePushpin(VEPushpin pushpin)
 {
     _activeObject.UpdatePushpin(pushpin);
 }
Esempio n. 20
0
 private void AddPushpinSettings(VEPushpin pushpin)
 {
     IProperties pushpinSettings = _settings.GetSubProperties(PUSHPINS).GetSubProperties(pushpin.PinId);
     pushpinSettings.SetFloat(PUSHPIN_LATITUDE, pushpin.VELatLong.Latitude);
     pushpinSettings.SetFloat(PUSHPIN_LONGITUDE, pushpin.VELatLong.Longitude);
     pushpinSettings.SetString(PUSHPIN_TITLE, pushpin.Title);
     pushpinSettings.SetString(PUSHPIN_IMAGE_URL, pushpin.ImageFile);
     pushpinSettings.SetString(PUSHPIN_DETAILS, pushpin.Details);
     pushpinSettings.SetString(PUSHPIN_MORE_INFO_URL, pushpin.MoreInfoUrl);
     pushpinSettings.SetString(PUSHPIN_PHOTO_URL, pushpin.PhotoUrl);
 }
Esempio n. 21
0
 public static string CreateLiveUrl(float latitude, float longitude, string reserved, string style, int level, VEPushpin[] pushpins, VEBirdseyeScene birdseyeScene)
 {
     return CreateMapUrl(LIVE_MAP_URL, latitude, longitude, reserved, style, level, pushpins, birdseyeScene);
 }
Esempio n. 22
0
 internal PushpinEvent(VEPushpin pushpin, PushPinAction action)
 {
     _pushpin = pushpin;
     _action  = action;
 }
 public void AddPushpin(VEPushpin pushpin)
 {
     if (_pushpinTable.ContainsKey(pushpin.PinId))
         UpdatePushpin(pushpin);
     else
     {
         _pushpinTable[pushpin.PinId] = pushpin;
         _pushpinList.Add(pushpin);
         EnqueueEvent(new PushpinEvent(pushpin, PushpinEvent.PushPinAction.Add));
     }
 }