Closed KanupriyaGoel closed 3 years ago
I didn't have time to take a look at everything, but here is what I can tell you so far :
1 - The CategorySet
parameter is still missing on the azure-maps-rest
package, apparently also on the javascript framework (https://atlas.microsoft.com/sdk/javascript/service/2/atlas-service.js). I've tried to specify it in the options using the CategorySet
as key or inside a queryParameters
propery, but without any success so far. I'll try to investigate that more tomorrow.
2 - Each method allows you to pass a timeout as parameter, and an Aborter
is automatically created from it or from the default timeout if no timeout has been given. For example, here is what happens on the searchNearby
method :
public searchNearby(location: GeoJSON.Position,
options?: atlas.Models.SearchGetSearchNearbyOptionalParams,
timeout: number = this._defaultTimeout): Promise<atlas.Response<atlas.Models.SearchNearbyResponse, atlas.Models.SearchGetSearchNearbyResponse, atlas.SearchGeojson>> {
return this
._searchUrl
.searchNearby(Aborter.timeout(timeout),
location,
options);
}
I'll try to take a look at that more deeply tomorrow.
Thanku for responding. Yes I checked your library in detail for parameters and tried passing in timeout as 3000, 1000, 100 etc consodering it may or may not be milliseconds. But my request didn't succeed. I want to check this so in case nothing is returned my map doesn't go into an infinite loop.
On Fri, Oct 30, 2020, 1:31 AM Arnaud Leclerc notifications@github.com wrote:
I didn't have time to take a look at everything, but here is what I can tell you so far :
1 - The CategorySet parameter is still missing on the azure-maps-rest package, apparently also on the javascript framework ( https://atlas.microsoft.com/sdk/javascript/service/2/atlas-service.js). I've tried to specify it in the options using the CategorySet as key or inside a queryParameters propery, but without any success so far. I'll try to investigate that more tomorrow.
2 - Each method allows you to pass a timeout as parameter, and an Aborter is automatically created from it or from the default timeout if no timeout has been given. For example, here is what happens on the searchNearby method :
public searchNearby(location: GeoJSON.Position, options?: atlas.Models.SearchGetSearchNearbyOptionalParams, timeout: number = this._defaultTimeout): Promise<atlas.Response<atlas.Models.SearchNearbyResponse, atlas.Models.SearchGetSearchNearbyResponse, atlas.SearchGeojson>> { return this ._searchUrl .searchNearby(Aborter.timeout(timeout), location, options); }
I'll try to take a look at that more deeply tomorrow.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/arnaudleclerc/ng-azure-maps/issues/21#issuecomment-718988165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXRFJ5O4I55KE5O3VTMJ4TSNHCZHANCNFSM4TD3XMGA .
I just checked the azure-maps-rest
library one more time, and there is no way with this library to pass parameters which are not defined in it to the API, like the categorySet
for example.
I realized that this package was released for the last time one year ago, and I can only imagine that the API have evolved since then. One possibility for ng-azure-maps
would be to call directly the API (like it's done on the WeatherService
), but I will need ultimately to handle by myself the retry policies, the refresh AAD token, the aborters, etc...
I'll try to get more information on the future evolution of this library and keep you up to date. If the decision is that I need to take some distance from azure-maps-rest
, I'll implement the calls to the API directly on ng-azure-maps
.
Here's the answer I got :
This module is updated periodically. We plan to do a big update in the first half of 2021.
I'll update the SearchService to call directly the API whenever I find some time to do it. I'll take a look at the azure-maps-rest package next year after a new version has been released.
@KanupriyaGoel I have published a version 2.1.0 which brings changes to the SearchService. The categorySet
parameter has been added to the searchNearby
. The timeout parameter has also been removed from all the methods.
Concerning your point 3, could you maybe try to either refine the search with the category set to limit the amount of results or try to set the limit parameter to 100 ? I can only assume that your request generates too many results.
For your point 4, you can find an example of a call to the searchInsideGeometry
API on the sample-search
project. Take a look at it and see if it works with your use case, and feel free to come back to me if you need any help with it.
Could you please try it out and let me know if it solves your issues ?
Hi @arnaudleclerc Thanku so much for taking out time to make an update but I see that you have changed from a promise to an observable which is helpful but then it is not returning SearchGeoJson anymore so in order to use this I will have to change my existing code to convert the search response to GeoJson for plotting it.
I have tried using a library for this but I have not been able to calculate the bounding box properties ad hence cannot setCamera on the map after loading the search results.
Regarding searchInsideGeometry I will try to post my code in case i cant make it work still.
My bad, I totally forgot to include those parts of the Promises. I'll take a look at it as soon as possible and try to publish an update.
Thanks so much, though I did a workaround for this but would be great to have it in the package itself.
Maybe you should need to keep extracting the feature on your application directly for now. I took another look at this and I start wondering if it's worth it to rework it one more time. I could include the getFeatures
method again, but that would mean I have to include some code from the azure-maps-rest
package directly into ng-azure-maps
, which I want to avoid. But I cannot use the azure-maps-rest
library to call the API because some parameters are missing. So in any situation, we lose some functionalities. Losing the getFeatures
is maybe the less annoying of those 2 in my opinion, because it can be easily reimplemented on the consumer application itself, like :
const features = [];
for (const result of response.results) {
event.map.markers.add(new atlas.HtmlMarker({
position: [result.position.lon, result.position.lat]
}));
features.push(new atlas.data.Point([result.position.lon, result.position.lat]));
}
event.map.setCamera({
bounds: atlas.data.BoundingBox.fromData(features)
});
Moreover, the azure-maps-rest
package should have an update first half next year, and I can only assume / hope that it will bring an update to the API calls, and what I am doing now is more or less developing an alternative version of it. I'd like to avoid that and wait for the next version to come out. I can only assume it will bring an update to the API calls as well as what is necessary for both an SPA and a geospatial application.
@KanupriyaGoel If that's fine with you, I will close this issue for now as there is no real progress which can be done for now. I will keep an eye on the future update of azure-maps-rest
and let you know if anything can be done after that.
Hi,
I am using search service and I have an issue and 2 questions on it.
CategorySet parameter is missing in SearchNearby
Using Timeout parameter in search service is not creating an aborter, can you please explain how it can he achieved
An issue with search nearby is that despite giving a radius (of 100-500 meters) points are returned only on top right side of the coordinate clicked. I have tried it with multiple geographies and it happened every single time
I am creating a polygon using isochrones around a point and I want to search in geometry. I have tried multiple ways but it does not seem to work as the coordinates I get by using CalculateRange when passed to SearchPolygon give error.