cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

moveMapMarker Not Working For UpdateNetworkDevice

Highlighted
Getting noticed

moveMapMarker Not Working For UpdateNetworkDevice

When I update a network device and set moveMapMarker to true, the map marker is not moved.  Funny thing is, if I go into the dashboard and click the pencil next to the address and click save (not changing the address that's in there currently), it's moved. So I know the address is good.  Code looks like this:

 

kwargs = {

                            'name': '12345 - Switch',
                            'address': '123 Any St, Sometown TN' , * Yes, I have a real address in here.
                            'moveMapMarker ': True
                        }
dashboard.devices.updateNetworkDevice('123456789', 'XXXX-XXXX-XXXX', **kwargs)

It will update the name and address fine so I know the call is not erroring out.  Anyone else have this issue?

8 REPLIES 8
Highlighted
Kind of a big deal

Re: moveMapMarker Not Working For UpdateNetworkDevice

I have used that API before but with GPS co-ordinates and that did update ok.

 

I'm picking it doesn't like something about the address format.  I note your address does not include the country.  Perhaps make your address more globally unique.

Highlighted
Getting noticed

Re: moveMapMarker Not Working For UpdateNetworkDevice

It worked when I used the 0.34 legacy API.  Best I can tell, it quit working when I moved to the 0.9x API.  I don't think it's the address format as I can login to the dashboard and click save with no change to the address and it will move it. 

Highlighted
Kind of a big deal

Re: moveMapMarker Not Working For UpdateNetworkDevice

I don't think that is a valid test.

 

It all depends on how the system is determining which country you are in if you leave that out of your address.  Perhaps when you use the dashboard and click save it is geolocating your location from the IP address you are browsing using.  The API couldn't risk using this approach.

 

I think you are running a risk if not using a fully formed address which includes the country the address is in.

 

 

Put another way, could you expect to write the address you have used on an envelope, and then post it from any country in the world, and expect to get it delivered?

Highlighted
Getting noticed

Re: moveMapMarker Not Working For UpdateNetworkDevice

I will give that a try when I get to the office tomorrow.   I'm just trying to figure out why it quit working.

Highlighted
Getting noticed

Re: moveMapMarker Not Working For UpdateNetworkDevice

I put USA at the end of the address and it still did not move the marker.  

Highlighted
Getting noticed

Re: moveMapMarker Not Working For UpdateNetworkDevice

Even if I specify the lat and lng, it does not move the marker.  

 

EDIT:  Specifying the lat and lng does work.  I was just doing it wrong.  What I ended up doing was setting up an account with Google and using their API to get the coordinates.

Highlighted
Getting noticed

Re: moveMapMarker Not Working For UpdateNetworkDevice

I actually got this to work by moving the moveMapMarker = True out of the kwargs variable and putting it inline with the function call.  Seems odd it will take some parameters in the kwargs but not all.  Ended up looking something like this:

 

kwargs = {

                            'name': '12345 - Switch',
                            'address': '123 Any St, Sometown TN' , * Yes, I have a real address in here.
                        }
dashboard.devices.updateNetworkDevice('123456789', 'XXXX-XXXX-XXXX', **kwargs, moveMapMarker = True)

Highlighted
Getting noticed

Re: moveMapMarker Not Working For UpdateNetworkDevice

I also found my original issue with having the moveMapMarker in the kwargs dictionary.   I had a space after the moveMapMarker key.  I would expect this to error out but the code simply ignored it.  

Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.