Select to view content in your preferred language

How to get multiple basemaps to show up in Tax Parcel Viewer on mobile device

2206
4
09-05-2013 01:05 PM
Labels (1)
JayGeisen
Regular Contributor
How do you get basemaps to show up in the basemap switcher on a mobile device? I have two cached basemaps in my app (both same cache schema and spatial reference). If I set useForMobileDevice to true for both in the config.js, then they both draw over the top of each other. If I set one to true and one to false, then only one draws, but neither of them show up in the map switcher window on a mobile device. They do, however, show up on a desktop machine and are switchable as you'd expect. Any ideas?
0 Kudos
4 Replies
SebastianRoberts
Frequent Contributor
Jay,
  I got caughton that one too and finally found that the intention of the template was to not use the basemap switcher on the mobile device at all.  The UseForMobileDevice property is only supposed to be set on one basemap.  If you wanted to implement the base map switcher on a mobile device you would have to dig into the javascript and css and implement the functionality yourself.
Sebastian Roberts
0 Kudos
JayGeisen
Regular Contributor
Thanks for the reply, Sebastian. I guess that's what I'm going to have to do. Any idea where to begin?
0 Kudos
SebastianRoberts
Frequent Contributor
For staters, in the basemapGallery.js file, you'll want to get rid of the if(isMobileDevice) conditional and get rid of the else loop.  That will set up the basemap elements for any device.  You may also need to edit the ShowBaseMaps function in the utils.js if the basemap dropdown doesn't render correctly on mobile devices.  There likely are some other pieces, but if you start with those two and debug on a mobile device, or hard code isMobileDevice=true in the init funciton and debug on your desktop you should be able to find any other missing pieces.
0 Kudos
JayGeisen
Regular Contributor
Thanks, Sebastian. I actually pieced this together on my own yesterday and was going to post the changes to this thread. But you beat me to it. 🙂
0 Kudos