Re: [Geomoose-users] Geomoose 3, URL call to start a service with parameters

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] Geomoose 3, URL call to start a service with parameters

Brent Fraser
Hi Michael,
 
   There is no explicit support in GeoMoose 3 that I know of.  But if you just want to set the initial view using lon,lat, zoom, you could invent your own url query parameters and have a url like:
 
 http://myserver/mymoose?setView=-114,51,5
 or
 http://myserver/mymoose?lon=-114&lat=51&zoom=5
 
 And modify your app.js to:
 
 - parse the url to extract lon,lat,zoom, starting with:
          const url_queryString = window.location.search
                 :
         const lon= ...
         const lat=...
         const zoom=....
 
 - project the coordinates
         const point = Proj.transform([lon, lat], 'EPSG:4326', 'EPSG:3857');
 
 - set the view
       app.setView({ center: point,  zoom: zoom });
 
 Building method to handle service names and parameters would be more work.
 
 Best Regards,
 Brent Fraser
 
 
 
 -------- Original Message --------

> From: "Reynolds, Michael J. (MNIT)" <[hidden email]>
> Sent: June 9, 2020 6:13 AM
> To: "geomoose-users-osgeo" <[hidden email]>
> Subject: [Geomoose-users] Geomoose 3,URL call to start a service with parameters
>
> Is there a way to call a service or action by using a url parameter? If not, in the app.js could I inspect the URL parameters and if I see a particular parameter name (for example "service"), initiate a service after the app loads?
>
> We've got user cases where users have Latitutde Longitude (WGS84) for locations which they would like to pass to a Geomoose URL as parameters to go to that location directly. Users have noticed the coordinate values inherent in a Geomoose url but converting from WGS84 to web mercator is an extra step.
>
> Any tips appreciated.
>
> Michael Reynolds
>
> Application Support | Application Portfolio Management (APM)
>
> Minnesota IT Services | Partnering with MnDOT
>
> 359 John Ireland Blvd.
>
> St. Paul, MN 55155
>
> O: 651-366-4918
>
> Information Technology for Minnesota Government | mn.gov/mnit<http://mn.gov/mnit>
> _______________________________________________ Geomoose-users mailing list [hidden email] https://lists.osgeo.org/mailman/listinfo/geomoose-users


_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users