SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Maps

Reply
 
Thread Tools Display Modes
Old 26/08/2008, 08:47 AM   #1
DracoBlue
Gangsta
 
Join Date: Apr 2006
Posts: 817
Reputation: 49
Default [PHP+DJSON] DMap 0.4 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

Hello,

since it's pretty difficult to get GoogleMaps working with flat maps and with samp, I took some time and put djson together with google maps and a small php-config-file: dmap was born!

Links:
- @requires djson >=1.5.2
- Download: 2,4MB (Source+Map+Icons)
- Demo: EveryStuff, GTA:Tournament
- HowTo: Add Shop/Extra icons

Its published under MIT-License. Use it, love it, hack it, sell it!

The architecture of dmap is made that way, that you can display anything at that page.
Just add an items element with icon!, text!, name!, id! and pos/x and pos/y in your gamemode to dmap_feed.json and you'll have a marker on the website! If you need _any_ help extending dmap, post here!

How to get it running?
1. Add dmap_GameModeInit() in your GameModeInit and dmap_GameModeExit() in your GameModeExit.
2. Recompile the GameMode!
3. Create a folder at your website. Sign up for a Google-Api-Key for that website address.
4. Copy all files from htdocs to the new website folder you created.
5. Configure config.inc.php that way, that the api-key is yours, and the "data feed" config points directly to your scriptfiles folder.
6. Have fun!

My scriptfiles/dmap_feed.json is not created!?
If you properly added dmap to your gamemode, launching it, should result in the following text:
Code:
 <dmap> DMap 0.3 // (c) 2008 DracoBlue // http://www.dracoblue.net
 <dmap> Loading ...
 <dmap> .. done!
If it doesn't: Doublecheck your gamemode, recompile it and run again! The file dmap_feed.json should appear right after that intro.

- Draco
__________________
Auto-Indent Your Code online with TidyPawn

dcmd 1.0 | dini 1.6 | djson 1.6.2 (The offic. Dini²) | DMap 0.4 | DModule 0.13 (Dynamic GM/FS) | DUDB 2.4 | DTest 1.2 | Dutils 1.10

[dracoblue's dev-diary][php + javascript developer][serverside javascript mvc framework]


Last edited by DracoBlue; 23/07/2010 at 09:01 PM.
DracoBlue is offline   Reply With Quote
Old 26/08/2008, 10:05 AM   #2
|CrippinBloodDrippin|
Huge Clucker
 
Join Date: Aug 2008
Posts: 372
Reputation: 0
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

wooooooooooooo first post and nice
|CrippinBloodDrippin| is offline   Reply With Quote
Old 26/08/2008, 10:12 AM   #3
DracoBlue
Gangsta
 
Join Date: Apr 2006
Posts: 817
Reputation: 49
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

Quote:
Originally Posted by MaTrIx4057
Very nice. But will you make like more info?? Armour,money, respect etc?? Im using delux's live map and its with more info and its google map too.
I will add more info. Actually dmap is more like an "engine" to use googlemaps with samp. So you can set whatever text you want as description as soon as one clicks the marker.

See the line where it sets items/%d/text and add whatever text you want to have there . Currently it adds only Health: %f, this is why you see just Health: 90 for example.

- Draco
__________________
Auto-Indent Your Code online with TidyPawn

dcmd 1.0 | dini 1.6 | djson 1.6.2 (The offic. Dini²) | DMap 0.4 | DModule 0.13 (Dynamic GM/FS) | DUDB 2.4 | DTest 1.2 | Dutils 1.10

[dracoblue's dev-diary][php + javascript developer][serverside javascript mvc framework]

DracoBlue is offline   Reply With Quote
Old 26/08/2008, 12:53 PM   #4
[IB]Scorcher
High-roller
 
[IB]Scorcher's Avatar
 
Join Date: Nov 2007
Posts: 1,736
Reputation: 7
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

Three letters: WOW
[IB]Scorcher is offline   Reply With Quote
Old 26/08/2008, 02:46 PM   #5
[M]deLux
Huge Clucker
 
Join Date: Jun 2007
Posts: 444
Reputation: 0
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

nice, but whats the difference to delux live maps?
[M]deLux is offline   Reply With Quote
Old 26/08/2008, 03:08 PM   #6
BlueG
Beta Tester
 
BlueG's Avatar
 
Join Date: Sep 2007
Location: Los Angeles, CA
Posts: 230
Reputation: 258
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

Quote:
Originally Posted by [M
deLux ]
nice, but whats the difference to delux live maps?
The difference is that he included the full source code for his script.He also used a different way to read the data from a file to create the map icon's.

Btw nice work draco!
BlueG is offline   Reply With Quote
Old 26/08/2008, 03:25 PM   #7
[M]deLux
Huge Clucker
 
Join Date: Jun 2007
Posts: 444
Reputation: 0
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

Quote:
Originally Posted by DracoBlue
Actually dmap is more like an "engine" to use googlemaps with samp.
yeah, ok i see. so it stays alot easier to use mine

nice work btw - in which cycles is the map refreshed?
[M]deLux is offline   Reply With Quote
Old 26/08/2008, 03:26 PM   #8
DracoBlue
Gangsta
 
Join Date: Apr 2006
Posts: 817
Reputation: 49
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

Actually this is all you need to run that script on any server of your choice completely independent from dracoblue.net .

Data is saved as json (thatswhy using djson), so it's faster (less bandwith) and of course different to xml like in the delux one.

Actually I made dmap with the purpose to create a "display" for information: Players/Shops/Points, just be adding/removing items from the big items-array in the .json file. All updating as soon as the .json file updates! No changes to the .html-side/map-side needed!

- Draco
__________________
Auto-Indent Your Code online with TidyPawn

dcmd 1.0 | dini 1.6 | djson 1.6.2 (The offic. Dini²) | DMap 0.4 | DModule 0.13 (Dynamic GM/FS) | DUDB 2.4 | DTest 1.2 | Dutils 1.10

[dracoblue's dev-diary][php + javascript developer][serverside javascript mvc framework]

DracoBlue is offline   Reply With Quote
Old 26/08/2008, 03:28 PM   #9
DracoBlue
Gangsta
 
Join Date: Apr 2006
Posts: 817
Reputation: 49
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

[edit]*cough* sorry for doublepost[/edit]

Quote:
Originally Posted by [M
deLux ]
nice work btw - in which cycles is the map refreshed?
5 seconds. Look at the source .

Btw. you are not using a flat map on google, so your calculation looks a bit confusing maybe inaccurate . Check that flat map projection called EuclideanProjection from: http://econym.googlepages.com/example_custommapflat.htm .

Quote:
Originally Posted by [M
deLux ]
Quote:
Originally Posted by DracoBlue
Actually dmap is more like an "engine" to use googlemaps with samp.
yeah, ok i see. so it stays alot easier to use mine
Easy depends on the fact what they actually want to do with it.

- Draco
__________________
Auto-Indent Your Code online with TidyPawn

dcmd 1.0 | dini 1.6 | djson 1.6.2 (The offic. Dini²) | DMap 0.4 | DModule 0.13 (Dynamic GM/FS) | DUDB 2.4 | DTest 1.2 | Dutils 1.10

[dracoblue's dev-diary][php + javascript developer][serverside javascript mvc framework]

DracoBlue is offline   Reply With Quote
Old 26/08/2008, 03:31 PM   #10
[M]deLux
Huge Clucker
 
Join Date: Jun 2007
Posts: 444
Reputation: 0
Default Re: [PHP+DJSON] DMap 0.1 - Dynamic Website Player/Car/Obj/Shop Map(GoogleMaps based)

yeah thanks - i noticed this afterwards but now it is working like this, so i wont change it just to have some more proper coords in the source

and i can ensure you that the positions are accurate on my map
[M]deLux is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] [FS] nCars (DYNAMIC VEHICLES - DJSON VERSION) Norn Filterscripts 22 20/04/2012 10:44 PM
[FilterScript] [FS] ShopSystem - Fully menu-based Vehicle and Ammunation-style Weapons Shop Darkimmortal Filterscripts 56 31/12/2010 12:25 AM
Player Statistics on Website Headshot1108 Help Archive 10 22/05/2010 05:52 PM
Player Statistic on the website CashisSimko Help Archive 0 28/12/2009 11:20 PM


All times are GMT. The time now is 01:41 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.