Need Help NKMapview...

Ask questions and share your skills here

Need Help NKMapview...

Postby stephen » Fri Jul 30, 2010 4:48 pm

Hi,

I was just wondering if its possible for people to select a location on the map (NKMapview). I need the user to select a location on the map so I can store it in SQLite(maybe the coordinates) and display it on the map later.

Please let me know if this is possible and how I can move forward whit it.

Thank You..
stephen
 
Posts: 23
Joined: Fri Jul 30, 2010 4:24 pm

Re: Need Help NKMapview...

Postby marcw7174 » Fri Jul 30, 2010 8:19 pm

I dont think this is possible using the NKMapView at the minute.
marcw7174
 
Posts: 38
Joined: Thu Jul 01, 2010 10:38 pm

Re: Need Help NKMapview...

Postby mliga666 » Fri Jul 30, 2010 9:13 pm

Open a feature request, i'll second it. maybe a draggable pin?
mliga666
NimbleKit Expert
 
Posts: 135
Joined: Thu Dec 03, 2009 8:38 pm

Re: Need Help NKMapview...

Postby apt » Sat Jul 31, 2010 2:12 am

I was just about to post exactly the same question, Having the ability to get lat and lon from clicking on a map (dragging and dropping a pin on the map) would be a very useful feature. If its not already added as a ticket I'll add it.

Adrian


I've added a ticket: http://www.nimblekit.com/bugs/view.php?id=240
Adrian Thompson
Founder
http://www.taptapp.co.uk

NimbleKit Registered User: U853078901
User avatar
apt
NimbleKit Expert
 
Posts: 322
Joined: Fri Jan 29, 2010 11:52 pm
Location: Sheffield, UK

Re: Need Help NKMapview...

Postby apt » Sat Jul 31, 2010 11:05 am

While we are waiting for this feature we could 'hack' something together using getDisplayRegion() as this gets the centre lat and lon of the current view. Used in conjunction with getUserLocation() and adding a crosshair overlay onto the map we could make a rudimentary location picker.

Thoughts?
Adrian Thompson
Founder
http://www.taptapp.co.uk

NimbleKit Registered User: U853078901
User avatar
apt
NimbleKit Expert
 
Posts: 322
Joined: Fri Jan 29, 2010 11:52 pm
Location: Sheffield, UK

Re: Need Help NKMapview...

Postby thedjmixman » Sun Aug 01, 2010 3:25 am

This is a good idea...

Would an overlay prevent usage of the map?
User U1318808401
User avatar
thedjmixman
NimbleKit Expert
 
Posts: 61
Joined: Sun Jun 13, 2010 4:05 am
Location: Kent, UK

Re: Need Help NKMapview...

Postby thedjmixman » Sun Aug 01, 2010 4:50 am

If a page was dedicated to the user selecting a location, we could do it so that we use Sunny's
<body ontouchmove="ontouchstart="OnTouchStart(event);"">

Calculate how off-centre the screen is pressed, then adjust the map to a new centre coordinate, with the aim of having the user centre the map to the desired location. The crosshair shouldn't interfere with the screen touch with that method?

A "done" button can then be used which can save the current centre coordinate in SQLite, as a parameter, sent off via Ajax or anything you want.

Or is there a simpler way?
User U1318808401
User avatar
thedjmixman
NimbleKit Expert
 
Posts: 61
Joined: Sun Jun 13, 2010 4:05 am
Location: Kent, UK

Re: Need Help NKMapview...

Postby Eviserator » Sun Aug 01, 2010 2:53 pm

thedjmixman wrote:This is a good idea...

Would an overlay prevent usage of the map?


No not at all. I currently use the getDisplayRegion() to do this very thing although I like the crosshair idea. Can someone make one for the team to use like they did the "Google" logo?

Below is a function I use when roaming around the map to get the center of the LAT/LNG pair and then update the map with my data for that area.

function GetMapCenterLocation()
{
// Get center of map coordinates
var loc = map.getDisplayRegion();

// Split LAT/LNG from the text data
var geoLoc = loc.split(",");

// Turn off the GPS update or lose the current LAT/LNG
map.showUserLocation("no");

map.clearAnnotations();

// Send LAT/LNG to map update function (geoLoc[1] = LAT, geoLoc[0]=LNG)
locationUpdated(geoLoc[1], geoLoc[0], 0, 0, 0);
}
Skip Potter, Living a mobile life...
http://www.pottertech.com
NK Registered: U797426801
User avatar
Eviserator
NimbleKit Expert
 
Posts: 78
Joined: Sun Jan 24, 2010 7:59 am
Location: Woodbridge, Virginia

Re: Need Help NKMapview...

Postby Eviserator » Wed Aug 18, 2010 10:32 pm

Since we are talking about NKMapView tricks...

Can we put up some other graphic other than the RED, GREEN and PURPLE Pin somehow? I would like other options and more colors or be able to make my own graphical "pins" and drop them at a specified LAT, LNG. Is that possible already and I am missing it in the NK Docs?
Skip Potter, Living a mobile life...
http://www.pottertech.com
NK Registered: U797426801
User avatar
Eviserator
NimbleKit Expert
 
Posts: 78
Joined: Sun Jan 24, 2010 7:59 am
Location: Woodbridge, Virginia

Re: Need Help NKMapview...

Postby nicole » Wed Aug 18, 2010 10:41 pm

Eviserator wrote:Can we put up some other graphic other than the RED, GREEN and PURPLE Pin somehow? I would like other options and more colors or be able to make my own graphical "pins" and drop them at a specified LAT, LNG. Is that possible already and I am missing it in the NK Docs?

I'm looking for this feature too. It would be very lovely if we could have customized pin image or color.
nicole
 
Posts: 12
Joined: Tue Aug 17, 2010 9:38 pm

Next

Return to How To...

Who is online

Users browsing this forum: No registered users and 1 guest