We are in the process of moving our map creation out of the view and moving to the controller, but by doing so a new error has cropped up. We no longer have access to the “setCurrentBackgroundMapType” method to change Google background layers. The error we receive is “Object # has no method ‘setCurrentBackgroundMapType’”. I still see the method in “func_GeoResource.axd”, but it apparently is not attached to our map name “Map1”.
The map displays fine and I can access other client side methods on the Map1 object (setLayer, setCenter, etc.).
Any ideas?
Thanks,
Chuck
setCurrentBackgroundMapType method not found error
Hi Chuck,
I tried to remove the map initialization from view to controller, and seems the function still can be called by Map1 object. I attached the view and controller files here in case you will use it to compare.
As I guess, I am not sure if there are multi “Map1” object in the end of html.Besides, we also need to set the map id as “Map1” in controller and then all the helper functions will attach to the object.
If the issue persists, would you mind to let us know how you use the method in your codes, or send us the view and controller files?
Thanks,
Troy
post11751.zip (1.21 KB)
Thanks for your response Johnny. It appears the issue was with the ordering of the jQuery file. We moved the jQuery load to the and it resolved the issue.
Hi Chuck,
Good to hear you figure out it.
Any questions, don’t hesitate to let us know.
Regards,
Troy