cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Bing map push pin with LookUp syntax

Hi, I'm trying to add pushpin for a static bing map to display the coordinates from my data tables. I did a test and know it will work, however, when I'm trying to develop my own I have an issue: 

test code:

 

 

BingMaps.GetMap(
    "Road",
    10,
    -35.724477, 174.317419,
    {pushpin:-35.724477 & "," & 174.317419&";51"})

 

 

 my code:

 

 

BingMaps.GetMap(
	"Road",
	15,
	LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,Y), LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,X),
	{pushpin:LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,Y) & "," & LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,X) & ";51"})

 

 

The code can work only without the {pushipin...} part. Since I'm new to VBA, can anyone give me an ideal regarding how to solve it?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @Anonymous ,

 

There are two solutions.

1. the first workaround is to format these latitude/longitude to be string, please modify your code as follows:

 

BingMaps.GetMap(
	"Road",
	15,
	LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,Y), LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,X),
	{pushpin:Text(LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,Y)) & "," & Text(LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,X)) & ";51"})

 

 2. the second workaround is to save the latitude/longitude to variables in Screen.OnVisible property

 

Set(VarLatitude, LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,Y));
Set(VarLongitude, LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,X))

 

then set the Image property as follows

 

BingMaps.GetMap(
    "Road",
    15,
    VarLatitude, VarLongitude,
    {pushpin:VarLatitude&","&VarLongitude&";51"})

 

Snipaste_2020-06-10_14-01-54.png

Hope this helps

Sik

View solution in original post

3 REPLIES 3
shinichi_kawara
Advocate I
Advocate I

Hi polaris,

This is a Japanese video, but is the following helpful?
https://youtu.be/ChfmbFZ9o1g

v-siky-msft
Community Support
Community Support

Hi @Anonymous ,

 

There are two solutions.

1. the first workaround is to format these latitude/longitude to be string, please modify your code as follows:

 

BingMaps.GetMap(
	"Road",
	15,
	LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,Y), LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,X),
	{pushpin:Text(LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,Y)) & "," & Text(LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,X)) & ";51"})

 

 2. the second workaround is to save the latitude/longitude to variables in Screen.OnVisible property

 

Set(VarLatitude, LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,Y));
Set(VarLongitude, LookUp('[dbo].[n_base]', slip_id = dd_slip1.Selected.Result,X))

 

then set the Image property as follows

 

BingMaps.GetMap(
    "Road",
    15,
    VarLatitude, VarLongitude,
    {pushpin:VarLatitude&","&VarLongitude&";51"})

 

Snipaste_2020-06-10_14-01-54.png

Hope this helps

Sik

View solution in original post

Anonymous
Not applicable

Thank you very much! It is really helpful!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,889)