Hello:
I want to intialize igMap at máximum space available on the Windows. I want initially the map is centered on a given groagraphicall coordinates.
I tried to precalculate free width and height, and set to igmap at inicialization, but map center position changes depending on the aspect ratio of the window. I can't convert coordinates using getZoomFromGeographic because igMap has not been initialized, too.
How can achieve this?
Thanks
Hello Isidoro, Thank you for posting in the community !
In this scenario it should be possible to calculate the position and set the window rectangle immediately after the definition for the map:
$(function () { $("#map").igMap({ width: document.body.offsetWidth, height: document.body.offsetHeight, crosshairVisibility: "visible", verticalZoomable: true, horizontalZoomable: true, overviewPlusDetailPaneVisibility: "visible", overviewPlusDetailPaneBackgroundImageUri: "../../images/samples/maps/world.png", panModifier: "control", backgroundContent: { type: "openStreet" }, series: [{ type: "geographicSymbol", name: "worldCities", dataSource: data, latitudeMemberPath: "Latitude", longitudeMemberPath: "Longitude", markerType: "automatic", markerCollisionAvoidance: "fade", markerBrush: "#1B559D", markerOutline: "black", showTooltip: true, tooltipTemplate: "cityTemplate" }], windowResponse: "immediate", windowRect: { left: 1, top: 1, height: 1, width: 1 }, }); var zoom = $("#map").igMap("getZoomFromGeographic", { left: 0, top: 50, width: 3, height: 3 }); $("#map").igMap("option", "windowRect", zoom); });
Attached is also a sample illustrating this in practice. Hope this helps. Please do not hesitate to contact me if you have any questions.
But getZoomFromGeographic that I need for calculate the zoom doesn't function at this point.