[ANN] mergMK 2

Find out what's going on with LiveCode (the company), product releases, announcements, and events.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

[ANN] mergMK 2

Post by monte » Mon Nov 11, 2013 3:36 am

Hi LiveCoders

Version 2 of mergMK has just been released providing even more features of Apple's powerful MapKit via easy to use LiveCode commands and functions. The new features are:
- Region changed callback
- User location changed callback
- Animation of custom image pins when adding them to the map and when the user drags and drops them
- An optional image on the left side of the annotation callout
- Circular overlays
- The option to set an offset relative to the centre of the image for custom image pins to make it easier to place the pin head on the coordinate

mergMK 2 is available from http://mergext.com at the same price of $49 and as part of mergExt Complete for $299.

Cheers

Monte
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

ChrisMukrow
Posts: 73
Joined: Mon Nov 12, 2012 4:13 pm

Re: [ANN] mergMK 2

Post by ChrisMukrow » Sat Dec 07, 2013 9:17 pm

Nice, looking good! Is this version also more stable? We got some memory problems with mergMK 1 (mostly with zooming in/out).

Chris

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: [ANN] mergMK 2

Post by monte » Sun Dec 08, 2013 8:55 am

I haven't had any reports of issues like that. Perhaps open up a support ticket if you have a recipe for the issue.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: [ANN] mergMK 2

Post by FireWorx » Sun May 11, 2014 6:47 am

Does mergMK allow you to incorporate .kml file overlays? The idea is that I load a HTML map that references a kml file on a web server as it loads. The kml file has 1000 pins that when clicked on provide information to the user.
Thanks
Dave

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: [ANN] mergMK 2

Post by monte » Thu May 22, 2014 6:18 am

You would need to parse the kml yourself in order to place the annotations on the map but yes you can add interactive pins/annotations to the map.

Some info on kml: https://developers.google.com/kml/documentation/kml_tut

You could also use any other convenient file format or database if you are in control of the file on the server... if it were me and I had control of the file I'd use json then mergJSON to turn it into an array of placemarks...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

mergMK 2

Post by FireWorx » Sat Jun 07, 2014 9:38 am

I was able to load a 1000 annotation pins using a similar script as shown below. However how do I go about replacing those pins with a custom image?

repeat for revNumberOfRecords(tQuery)
put revDatabaseColumnNamed(tQuery,"latitude") into tLat
put revDatabaseColumnNamed(tQuery,"longitude") into tLong
put revDatabaseColumnNamed(tQuery,"title") into tTitle
put revDatabaseColumnNamed(tQuery,"id") into tID
put mergMKAddAnnotation((tLat,tLong),tTitle) into sAnnotationIDA[tID]
end repeat

is there something in the code below that can be reformatted and work in the last line of the repeat loop?

put mergMKAddAnnotationWithImage(mergMKGet("center coordinate"),fld "title",image 1,fld "subtitle", \
the hilite of btw "show callout",the hilite of btn "animate drop",the hilite of btn "draggable",tOffset,image 1,the hilite of btn "show callout button")

Thanks Dave

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: [ANN] mergMK 2

Post by monte » Mon Jun 09, 2014 7:31 am

Hi Dave

I'm not really sure what you're asking here but I vaguely think you might want:

Code: Select all

put the text of image "pin" into tImage
repeat for revNumberOfRecords(tQuery)
  put revDatabaseColumnNamed(tQuery,"latitude") into tLat
  put revDatabaseColumnNamed(tQuery,"longitude") into tLong
  put revDatabaseColumnNamed(tQuery,"title") into tTitle
  put revDatabaseColumnNamed(tQuery,"id") into tID
  put mergMKAddAnnotationWithImage((tLat,tLong),tTitle, tImage) into sAnnotationIDA[tID]
end repeat
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: [ANN] mergMK 2

Post by FireWorx » Mon Jun 09, 2014 6:44 pm

Hi Monte,
That didn't quiet work for me so let me try and be more specific. The script below pulls lat long coordinates and some other identifying info out of a hidden field and places a 1000+ pins on the map. However what I would like is to substitute an image of a fire hydrant for the pins. Even more specifically based on the variable tColor being either orange, red, blue, or green I would like to insert a hydrant image of that color onto the map. Here is the script that works for dropping a single colored pin at each location.

on mouseUp
set itemdelimiter to tab
repeat with x = 1 to the number of lines of field "Hydrant Data"
put item 1 of line x of field "Hydrant Data" into tID
put item 2 of line x of field "Hydrant Data" into tLat
put item 3 of line x of field "Hydrant Data" into tLong
put item 4 of line x of field "Hydrant Data" into tFlow
put item 5 of line x of field "Hydrant Data" into tColor
put tFlow && tColor into tTitle
put mergMKAddAnnotation((tLat,tLong),tTitle) into sAnnotationIDA[tID]
end repeat
end mouseUp
So the idea would be to have 4 images to choose from OrangeHydrant.png, GreenHydrant.png, etc
Then perhaps a script like

on mouseUp
set itemdelimiter to tab
repeat with x = 1 to the number of lines of field "Hydrant Data"
put item 1 of line x of field "Hydrant Data" into tID
put item 2 of line x of field "Hydrant Data" into tLat
put item 3 of line x of field "Hydrant Data" into tLong
put item 4 of line x of field "Hydrant Data" into tFlow
put item 5 of line x of field "Hydrant Data" into tColor -- CONTAINS EITHER Orange,Red,Blue or Green
put tFlow && tColor into tTitle
put tColor & "Hydrant.png" into tMyImageName -- tImage value is now something like OrangeHydrant.png
put the text of image tMyImageName into tImage
put mergMKAddAnnotationWithImage((tLat,tLong),tTitle, tImage) into sAnnotationIDA[tID]
end repeat
end mouseUp
Am I getting close? Is what I am trying to do possible?
Thanks
Dave

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: [ANN] mergMK 2

Post by FireWorx » Tue Jun 10, 2014 8:55 pm

How about some sample code to drop a custom image annotation somewhere on the screen other than the center.

This doesn't seem to work

put quote & "36.986927,-121.919994" & quote into pCoordinate
put mergMKAddAnnotationWithImage(mergMKGet(pCoordinate) ,"My title",image 1)
or
put mergMKAddAnnotationWithImage(mergMKGet, pCoordinate ,"My title",image 1)
or
put mergMKAddAnnotationWithImage(mergMKGet, "36.986927,-121.919994" ,"My title",image 1)

If you could provide a correct code example that would be helpful. Thanks

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: [ANN] mergMK 2

Post by monte » Fri Jun 13, 2014 2:31 am

Hmm... I did provide the sample above but her goes again based on your post:

Code: Select all

put 36.986927,-121.919994 into pCoordinate
put mergMKAddAnnotationWithImage(pCoordinate ,"My title",image 1)
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: [ANN] mergMK 2

Post by FireWorx » Thu Jun 19, 2014 6:19 am

Works great. Thanks for the clarification. I have another question. If a guy was able to track the lat long coordinates of say 1/2 dozen moving vehicles by downloading their coordinates from a web server does mergMk have the ability to display 6 moving dots across your map simultaneously? is it possible to display more than one radar style dot with ring around it on the screen?
Thanks!

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: [ANN] mergMK 2

Post by monte » Mon Jul 07, 2014 12:52 am

I think to do that nicely you would want some kind of animated move from one coordinate to another and mergMK doesn't have anything like that. I have a new release coming soon that allows you to edit properties of annotations but that would make the annotation jump from one location to the next.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Announcements”