Hi,
Is it possible to get the longitude and latitude of the visible area on screen?
The scenario is the user has zoomed into a city, I want to be able to get the upper left lat and long, the lower right lat and long and then based on those values go to the database and get all the branches in that area.
Simplistic code example.
The problem is that the e.upperLeft and e.LowerRight latitude and longitude values don't seem to represent what is in the visible area.
Sorry for my lack of understanding, this is the first time I have developed for maps so this may be a really stupid question! :-)
Regards,
Mark
Is it possible to get the longitude and latitude of the visible area on screen?
The scenario is the user has zoomed into a city, I want to be able to get the upper left lat and long, the lower right lat and long and then based on those values go to the database and get all the branches in that area.
Simplistic code example.
public
void
ItemsRequest(
object
sender, ItemsRequestEventArgs e)
{
var dataContext = page.DataContext
as
MappingViewModel;
if
(dataContext ==
null
)
return
;
//var minZoom = e.MinZoom;
var upperLeft = e.UpperLeft;
var lowerRight = e.LowerRight;
var branches = _repository.GetBranches(upperLeft.Latitude, upperLeft.Longitude, lowerRight.Latitude, lowerRight.Longitude);
dataContext.SetBranches(branches, e);
}
The problem is that the e.upperLeft and e.LowerRight latitude and longitude values don't seem to represent what is in the visible area.
Sorry for my lack of understanding, this is the first time I have developed for maps so this may be a really stupid question! :-)
Regards,
Mark