ThinkGeo.com    |     Documentation    |     Premium Support

MapSuite 9 Upgrade Issue With Draggable Markers

Hello,

We are currently using Map Suite MVC 8 in our project. I am in the process of upgrading to Map Suite MVC 9 (specifically build 9.0.0.129) and I have encountered an issue with draggable Markers in a SimpleMarkerOverlay. Whenever the marker is dragged the following OpenLayers code is throwing an exception when calling the function assigned to the Marker object’s display property due to the icon property being null. This did not occur prior to the upgrade to Map Suite MVC 9.

 OpenLayers.Marker = OpenLayers.Class({
	icon: null,
	lonlat: null,
	events: null,
	map: null,
	initialize: function(a, b) {
		this.lonlat = a;
		var c = b ? b : OpenLayers.Marker.defaultIcon();
		null == this.icon ? this.icon = c : (this.icon.url = c.url, this.icon.size = c.size, this.icon.offset = c.offset, this.icon.calculateOffset = c.calculateOffset);
		this.events = new OpenLayers.Events(this, this.icon.imageDiv)
	},
	destroy: function() {
		this.erase();
		this.map = null;
		this.events.destroy();
		this.events = null;
		null != this.icon && (this.icon.destroy(), this.icon = null)
	},
	draw: function(a) {
		return this.icon.draw(a)
	},
	erase: function() {
		null != this.icon && this.icon.erase()
	},
	moveTo: function(a) {
		null != a && null != this.icon && this.icon.moveTo(a);
		this.lonlat = this.map.getLonLatFromLayerPx(a)
	},
	isDrawn: function() {
		return this.icon && this.icon.isDrawn()
	},
	onScreen: function() {
		var a = !1;
		this.map && (a = this.map.getExtent().containsLonLat(this.lonlat));
		return a
	},
	inflate: function(a) {
		this.icon && this.icon.setSize({
			w: this.icon.size.w * a,
			h: this.icon.size.h * a
		})
	},
	setOpacity: function(a) {
		this.icon.setOpacity(a)
	},
	setUrl: function(a) {
		this.icon.setUrl(a)
	},
	display: function(a) {
		this.icon.display(a)
	},
	CLASS_NAME: "OpenLayers.Marker"
});

Hi Michael,

Thanks for reporting this issue, it proved to be a bug.

I think this bug had been fixed in the latest Daily Builds version 9.0.0.290(Production)&9.0.289.0(Development) or any higher version. Please get the fix from Product Center and have a try again.
Please make sure to clear the cache of browser before that.

Thanks,
Emil

Emil,

Looking at the Product Center the Daily Production build is only 9.0.0.273 dated 03/23/2016. The bug is definitely still present in that version.

Hi Michael,

I just manually upload the 9.0.0.296(Production), and please get it and let me know whether that works for you.

Thanks,
Emil

Thanks Emil,

It seem to be working now, as the exception is no longer occurring. I need to do some more testing to make sure no new issues occurred in changing from build 129 to 296, but everything seems good thus far.

I have one additional question. We are using IsDefaultJavascriptLibraryDisabled = true; and extracting the JavaScript files. We are then running them through a script beautifier so that they are easier to read when debugging and bundling them ourselves with MVC when deploying. I know that to extract them I need to run the project and navigate to servername/appname/filename.axd?v=x.x.x.x to extract them.

Is there a list somewhere of all the files in your library that gets updated when new files are added? When upgrading from version 7 to 8 of Map Suite the addition of binding_GeoResource.axd caused us some issues.

Hi Michael,

Sorry there is no place to query it currently, and thanks for your advice.
If we modify the JavaScript files, we will publish the details of modification to our wiki.

Please save the script to your folder, and modify your references follow this order as below:

 <script src="../../Scripts/opl_GeoResource.js"></script>
 <script src="../../Scripts/extension_GeoResource.js"></script>
 <script src="../../Scripts/helper_GeoResource.js"></script>
 <script src="../../Scripts/binding_GeoResource.js"></script>
 <script src="../../Scripts/parser_GeoResource.js"></script>
 <script src="../../Scripts/func_GeoResource.js"></script>
 <script src="../../Scripts/cm_GeoResource.js"></script>
 <script src="../../Scripts/msajax_GeoResource.js"></script>

Thanks,
Emil

Thanks Emil,

Fortunately, I already have all of those. Also, build 296 works.

Hi Michael,

Very glad to hear it works. Any questions please let us know.

Thanks,
Emil