WebMapViewer Location pin not working

Hi all,
I’m working on my first WebMapViewer project.
The Location pin does not appear on the map, although I followed the coding examples from the documentation.

In the Shown event handler I have this code:


Var location As New WebMapLocation(52.10477164158653, 5.144627996814239, "Thuis")
MyMap.GoToLocation(location)
MyMap.AddLocation(location)
MyMap.Zoom = 14

The map is shown correctly, but without a location pin.

What could be the cause for it.

Thanks for helping me out.

Reported bug:
# WebMapLocation does not show location pin when calling Add Location in 2020r1

If you look at the Eddie’s electronics sample, they use

'Show the customer location on the map
Var location As String = CityField.Text + ", " + StatePopup.SelectedRowValue + " " + ZipField.Text
CustomerLocation.ModeData = location
CustomerLocation.Search(location)

and that works (https://demos.xojo.com):

Yes, they should add sample code to ModeData and Search, current info on the documentation:

ModeData

ModeData As String

The data required for the Mode when it’s set to Place or Search.

Search

Search(Query As String)

Performs a maps query based upon the query passed.

No sample code, no extra information that indicates that using this will put a Pin on the map, etc.

Thanks a lot!
This means probably that it’s not possible to show multiple pins on the map.
Is this assumption correct? Or is there another way?

Correct, I don’t think there is a way to add multiple pins using the code above.

I don’t know of another way if you don’t want to buy 3rd party plugins.

1 Like

You could:

  1. Use Graffiti Web suite
    or

You can use Leaflet (https://leafletjs.com/) via

2.1) Writing your own WebSDK Control and and integrate with Leaflet
Here you can write to Leaflet and get feedback from Leaflet.

or ( if the requirements are not too heavy)

2.2) Try hosting Leaflet in a XOJO WebHTMLViewer.
2.2 is suitable if you only need to show location / pin / draw on Leaflet and not get feedback from Leaflet ( one way communication).

I am very hopeful we will see better WebMapViewer control in Xojo2023R2

1 Like