Reputation: 102
I have to update a userControl that was made using a web control (https://github.com/simplovation/webmapsve) that was a wrapper around Bing mapcontrol V6.3. Since the latter was discontinued by MS recently, we have to update. Using WebMapsVe is not an option anymore, the last commit to that repo was june 2016.
Obviously refactoring the entire application to use Bing maps control directly would be preferable, but not an option either, the app is so extensive, that would be too much work right now. So I'm trying to use the Bing mapcontrol v8 inside our userControl.
I have to update the map position based on a property of the userControl when the userControl property's value changes during the lifetime of the control. Since the Bing mapControl v8 is controlled by javascript I have to call a javascript function or update a value in javascript when the property changes. I can't really find a decent way to do this. I have googled for an answer to this till blue in the face but I can't come up with a decent answer.
I've tried both
ScriptManager.RegisterStartupScript() or ClientScript.RegisterClientScriptBlock()
to set a script, but it seems to work only once when the control is initialized. I can't find a way to trigger a script to update the map's position after startup time. I have also looked at setting a timeout in js to poll for a value, but I can't find a way to update that value from the code-behind where the property lives. What would be a good way to do this in a userControl?
Upvotes: 0
Views: 100
Reputation: 17954
Take a look at the Bing Maps V6.3 to V8 shim here: https://github.com/rbrundritt/BingMapsV63ToV8Shim
It might be easier than trying to migrate your code.
Upvotes: 0