Topic: Online Maps Polygon Performance Issue
Like you suggested in : http://forum.infinity-code.com/viewtopic.php?id=971
I am using onlineMapsDrawing api to draw elements, now I am drawing the border of the map as polygon (16821 verticles), which is quite a lot.
I did notice in case of using tileSet (which I am) there is this code :
public override void UpdateControl()
{
base.UpdateControl();
if (OnlineMapsTile.tiles == null) return;
UpdateMapMesh();
if (OnlineMapsDrawingElementManager.CountItems > 0)
{
if (drawingMode == OnlineMapsTilesetDrawingMode.meshes)
{
if (drawingsGameObject == null) InitDrawingsMesh();
int index = 0;
foreach (OnlineMapsDrawingElement drawingElement in OnlineMapsDrawingElementManager.instance)
{
drawingElement.DrawOnTileset(this, index++);
}
}
}
if (OnDrawMarkers != null) OnDrawMarkers();
Which in my guess is source of my performance issues on mobile device.
I did tried to override the 'OnlineMapsDrawingElement' create my own etc, but wasn't able to properly move it with movment of the map (added 'OnChangePosition', and 'OnChangeZoom' listeners, then tried .GetWorldPosition etc, but I didn't had reference point since you recreate polygons each time the map need to be updated).
My question is, Is there any reason why You are not creating polygon just once and then move it with the map and scale it properly ? In my opinion this would greatly increase performance?
Or am I mistaken and I am missing something ?
While I am able to create polygon on my own (later on I might write my own code to actually make png out of all verticles since its not dynamicaly loaded data anyway and move it on the map) I am still unable to detect how should I move the poly or by how much should I scale it to have correct behavior.