For learning porpoises I am trying to run the default map viewer set up and show the POIs stored in the orion public instance (orion.lab.fi-ware.org:1026).. but it does not work at all.
Following screenshots with the default provided configurations. It should show a bunch of Santander POIs if I understood well.
1.-Wired mashups schema:
2.- NGSI Source default settings:
3.- NGSI entity to POI default settings:
4.- Map viewer default settings:
5.- Map viewer result (No results at all :(( ):
Everything looks pretty straight forward but nothing is shown. Without understanding why it is not working I can not moving forward and work in my own implementation.
thanks in advance.
It looks to me like you have not obtained an authorization token (or you are not showing it in your question?). Without one you are not able to retrieve information from orion.lab.fi-ware.org.
One way to get a token is running this python script:
https://github.com/telefonicaid/fiware-figway/blob/master/python/get_token.py
Of course, you do need a FIWARE Lab account to get it.
The problem seems to be in the configuration of the "NGSI entity to POI". The Node, AMMS and Regulators entities provide their coordinates using the Latitud (latitude) and Longitud (longitude) attributes.
The final value for the "Coordinate attribute" setting should be: Latitud, Longitud
Related
I'm planning a climbing trip and I wanted to retrieve the climbing locations from a leaflet map.
I thought I could use chromedriver and selenium to get the information I wanted but I'm having difficulty scanning through all markers since I can't understand where all the informations are stored.
Could someone guide me through how I could get the information? (also without using selenium)
The map in question is: https://www.climbingsardinia.com/topos/maps/
Thank you in advance.
in that page you will see a global variable called cttm_markers, it contains all markers informations and relative coordinates.
For example, cttm_markers[0][[0].additionalData.title evaluates "M.te Arci – Trebina Longa".Further, cttm_markers[0][[0]._latlng is an object {lat,lng} that contains coordinates.
Try to open console and paste this: JSON.stringify(cttm_markers[0].map(c=>({title:c.additionalData.title,latlng:c._latlng}))), it will print a json.
One way to do it is to get some information on one of the markers and use this to search the request reponses made by the page (you can do this in the debug tools, usually opened with F12). One of the markers for example reveals the location "Grighini". The base request redirects to (in my case) https://www.climbingsardinia.com/topos/maps/?doing_wp_cron=1651158093.0027918815612792968750
Searching the response, reveals that in line 1908 there's the string "Grighini". This line contains a serialized JSON array, containing the markers.
I tried the azure-spatial-anchor-demo-package and it worked fine for me. Now I wanted to use azure in my project. In my current understanding, the coordinates of the anchor are stored. More precise information about whether it is a 3D object, and what it looks like, is not stored. If I'm wrong about this, please correct me.
Lets say I have 3 different objects: a car, house and tree.
All of them are anchors, which I instantiate in my scene. My current procedure is as follows:
_anchorModul.StartAzureSession();
I instantiate a car, house and tree and call for each of them CreateAzureAnchor();:
InstantiatedGo = Instantiate(GoToInstantiate, GetCurrentHitPosition(), Quaternion.FromToRotation(Vector3.back, _gazeProvider.HitInfo.normal)) as GameObject;
_anchorModul.CreateAzureAnchor(InstantiatedGo);
In the method CreateAzureAnchor() I set the type of my object via localCloudAnchor.AppProperties.Add("type", theObject.GetComponent<SomeClass>().Type);.
After that I save the anchors to disk via _anchorModul.SaveAzureAnchorIdToDisk();
But now I want to restart my application and get the objects at the right position. The right order should be:
Restart the application.
Get Azure Anchor from Disk
Start Azure Session
Find Azure Anchor
My Question: How do I get the found anchors, so I can access the properties I set and instantiate the related properties on my three objects?
My Specs:
Unity 2019.2.15
MRTK 2.2
AzureSpatialAnchors.unitypackage
MRTK.HoloLens2.Unity.Tutorials.Assets.AzureSpatialAnchors.2.2.0.0.unitypackage
MRTK.HoloLens2.Unity.Tutorials.Assets.GettingStarted.2.2.0.1.unitypackage
You need to make a request to the Azure service to locate an anchor using at least one of the ids saved. You can either send an array of ids or send one and ask for the nearby anchors.
I use Python for plotting geospatial data on maps.
For certain map-styles, such as ["basic", "streets", "outdoors", "light", "dark", "satellite", "satellite-streets"], I need a mapbox-access token and for some geospatial plotting packages like folium I even need to create my own link for retrieving the map-tiles.
So far, it worked great with the style "satellite":
mapbox_style = "satellite"
mapbox_access_token = "....blabla"
request_link = f"https://api.mapbox.com/v4/mapbox.{mapbox_style}/{{z}}/{{x}}/{{y}}#2x.jpg90?access_token={mapbox_access_token}"
However, when choosing "satellite-streets" as mapbox-tile-ID, the output doesn't show a background map anymore. It fails with inserting "satellite-streets", "satellitestreets" and "satellite_streets" into the aforementioned link-string.
Why is that and how can I come to know what's the correct tile-ID-name for "satellite-streets"?
I found an answer when reaching out to the customer support.
Apparently, one has to access the static APIs which have specific names listed on their website:
"In general, the styles that you mentioned including
"satellite_streets" that you are referencing are our classic styles
that are going to be deprecated starting June 1st. I would recommend
using our modern static API the equivalent modern styles. This
will allow you to see the most updated street data as well.
Like the example request below:
https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/1/1/0?access_token={your_token}
Here is more info on the deprecation of the classic styles and
the migration guide for them."
My personal adaptation after having tried everything out myself, is:
Via combining the above-mentioned with the details on how to construct a Mapbox-request link on this documention from mapbox' website,
I finally managed to make it work.
An example request looks like so (in python using f-strings):
mapbox_tile_URL = f"https://api.mapbox.com/styles/v1/mapbox/{tileset_ID_str}/tiles/{tilesize_pixels}/{{z}}/{{x}}/{{y}}#2x?access_token={mapbox_access_token}"
The tileset_ID_str could be e.g. "satellite-streets-v11" which can be seen at the following link containing valid static maps.
I’m using Typo3 (Version 6.2.14) and upgraded WEC_Map to version 3.1.3 because I saw a warning on my map which says that I need to use an API key for Google Maps.
So I’ve generated an API key for "Maps Static API" and inserted it in WEC Map Admin. (I’ve used the same key for Browser API Key and Server API Key. Only difference is that I’ve added the secret for the Browser API Key separated by a comma.)
If I’ve visit my FE User Map in the backend the map is showing.
In the frontend instead I get the following error: "
There doesn't seem to be anything to display. Make sure the map is configured correctly and there are users or markers set".
Inspecting the source code I saw that the script tag to maps.googleapis.com is not generated. It looks like this is causing the issue, but I don't know why it is happening.
I hope that someone using a similar setup can point me into the right direction.
Thank you guys. (It would be nice if someone could add the Tag for WEC_Map)
Ok I resolved this. The problem was that I was using the userGroups setting to filter the map markers by multiple user groups.
plugin.tx_wecmap_pi2 {
height = 500
width = 500
showDirections = 1
prefillAddress = 0
initialMapType = G_HYBRID_MAP
controls.mapControlSize = large
controls.showOverviewMap = 1
controls.showMapType = 1
controls.showScale = 1
userGroups = 2,3,5
pid = 2,3,5 # <-- This uses a AND condition
}
Since this setting is using an AND condition under the hood I received the error "There doesn't seem to be anything to display. Make sure the map is configured correctly and there are users or markers set"
In fact I opened a feature request for this 3 years ago. Unfortunately the feature request never made it into the plugin. But Jan Bartels posted a workaround as reply to the feature request. This workaround got lost while updating the extension.
Also recomment to the extension authors to make it more clear in their documentation that the property userGroups uses a AND condition.
I would like to get the distance between 2 markers but not as a direct line, more as a real path like it goes in this plugin -
https://github.com/perliedman/leaflet-routing-machine
I didn't find anything about using this plugin in the directive: angular-leaflet-directive,
if someone can guide how to make it done, it would be very appreciated.
thanks!
I am not sure if you specifically want to use leaflet routing machine to get distances... but if you do, maybe this info can get you started:
Set up a route on your map based on this example by the leaflet routing machine author:
https://www.liedman.net/leaflet-routing-machine/tutorials/interaction/
If you look at that example, there is an array called routes. Each route has some basic statistics associated with it, generated by OSRM. You can pull them by calling for example:
routes[0].summary.totalDistance
or
routes[0].summary.totalTime
Then you can do whatever you want with them. If you dig through the code on GitHub you can see more about how the data are moved around within the plugin and why the array is arranged that way:
https://unpkg.com/leaflet-routing-machine#3.2.12/dist/leaflet-routing-machine.js